refactor the web services to be cleaner

This commit is contained in:
2025-03-09 13:41:00 +03:30
parent 5f2cbf5f12
commit 905cacbd3b
5 changed files with 2697 additions and 2718 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@ class StoreRequest extends FormRequest
return [
'name' => 'required|string|unique:permissions,name',
'name_fa' => 'required|string',
'description' => 'required|string',
'description' => 'string',
'type' => 'required|string',
'type_fa' => 'required|string',
'need_province' => 'required|in:0,1',

View File

@@ -24,7 +24,7 @@ class UpdateRequest extends FormRequest
return [
'name' => "required|string|unique:permissions,name,{$this->permission->id}",
'name_fa' => 'required|string',
'description' => 'required|string',
'description' => 'string',
'type' => 'required|string',
'type_fa' => 'required|string',
'need_province' => 'required|in:0,1',

View File

@@ -45,4 +45,31 @@ class NikarayanService
return 0;
}
/**
* @throws SoapFault
*/
public function getRoadObservedProblemsByDate()
{
try {
$url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
$v = verta();
$month = $v->month < 10 ? '0' . $v->month : $v->month;
$day = $v->day < 10 ? '0' . $v->day : $v->day;
$date = $v->year . $month . $day;
$soap_client = new SoapClient($url);
return $soap_client->Get_RoadObservedProblems_ByDate(array(
'strUserName' => 'vaytelrop',
'strPassword' => 'VaYtelROP*2024',
'strStartDate' => $date,
'strEndDate' => $date
));
}
catch (\Exception $e) {
Log::channel('nikarayan')->error($e->getMessage());
throw $e;
}
}
}