refactor the web services to be cleaner
This commit is contained in:
File diff suppressed because it is too large
Load Diff
2643
app/Enums/NikarayanComplaints.php
Normal file
2643
app/Enums/NikarayanComplaints.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@ class StoreRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'name' => 'required|string|unique:permissions,name',
|
'name' => 'required|string|unique:permissions,name',
|
||||||
'name_fa' => 'required|string',
|
'name_fa' => 'required|string',
|
||||||
'description' => 'required|string',
|
'description' => 'string',
|
||||||
'type' => 'required|string',
|
'type' => 'required|string',
|
||||||
'type_fa' => 'required|string',
|
'type_fa' => 'required|string',
|
||||||
'need_province' => 'required|in:0,1',
|
'need_province' => 'required|in:0,1',
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class UpdateRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'name' => "required|string|unique:permissions,name,{$this->permission->id}",
|
'name' => "required|string|unique:permissions,name,{$this->permission->id}",
|
||||||
'name_fa' => 'required|string',
|
'name_fa' => 'required|string',
|
||||||
'description' => 'required|string',
|
'description' => 'string',
|
||||||
'type' => 'required|string',
|
'type' => 'required|string',
|
||||||
'type_fa' => 'required|string',
|
'type_fa' => 'required|string',
|
||||||
'need_province' => 'required|in:0,1',
|
'need_province' => 'required|in:0,1',
|
||||||
|
|||||||
@@ -45,4 +45,31 @@ class NikarayanService
|
|||||||
|
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user