create job for nikarayan
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers\V2\Dashboard;
|
namespace App\Http\Controllers\V2\Dashboard;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Jobs\UpdateRoadObservedInfoByNikarayanJob;
|
||||||
use App\Services\NikarayanService;
|
use App\Services\NikarayanService;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Hekmatinasser\Verta\Verta;
|
use Hekmatinasser\Verta\Verta;
|
||||||
@@ -570,7 +571,8 @@ class RoadObservationController extends Controller
|
|||||||
// }
|
// }
|
||||||
// $url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
|
// $url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
|
||||||
try {
|
try {
|
||||||
$result = $nikarayanService->updateRoadObservedInfoByNikarayan($request, $roadObserved, $files_path);
|
// $result = $nikarayanService->updateRoadObservedInfoByNikarayan($request, $roadObserved, $files_path);
|
||||||
|
$result = UpdateRoadObservedInfoByNikarayanJob::dispatch($request, $roadObserved, $files_path);
|
||||||
} catch (SoapFault $e) {
|
} catch (SoapFault $e) {
|
||||||
|
|
||||||
$msg = "error in send to nikarayan at" . date("Y-m-d H:i:s") . "\n" . 'rms: error in get road observation webservice babe!!!!' . "\n";
|
$msg = "error in send to nikarayan at" . date("Y-m-d H:i:s") . "\n" . 'rms: error in get road observation webservice babe!!!!' . "\n";
|
||||||
|
|||||||
34
app/Jobs/UpdateRoadObservedInfoByNikarayanJob.php
Normal file
34
app/Jobs/UpdateRoadObservedInfoByNikarayanJob.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use App\Models\RoadObserved;
|
||||||
|
use App\Services\NikarayanService;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use SoapFault;
|
||||||
|
|
||||||
|
class UpdateRoadObservedInfoByNikarayanJob implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
public $queue = 'nikarayan';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new job instance.
|
||||||
|
*/
|
||||||
|
public function __construct(public Request $request, public RoadObserved $roadObserved, public $files) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the job.
|
||||||
|
* @throws SoapFault
|
||||||
|
*/
|
||||||
|
public function handle(NikarayanService $nikarayanService): void
|
||||||
|
{
|
||||||
|
$nikarayanService->updateRoadObservedInfoByNikarayan($this->request, $this->roadObserved, $this->files);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user