create nikarayan fault model
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\NikarayanFault;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Services\NikarayanService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -11,6 +12,7 @@ use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use SoapFault;
|
||||
use Throwable;
|
||||
|
||||
class UpdateRoadObservedInfoByNikarayanJob implements ShouldQueue
|
||||
{
|
||||
@@ -27,8 +29,19 @@ class UpdateRoadObservedInfoByNikarayanJob implements ShouldQueue
|
||||
* Execute the job.
|
||||
* @throws SoapFault
|
||||
*/
|
||||
public function handle(NikarayanService $nikarayanService): void
|
||||
public function handle(NikarayanService $nikarayanService)
|
||||
{
|
||||
$nikarayanService->updateRoadObservedInfoByNikarayan($this->request, $this->roadObserved, $this->files);
|
||||
return $nikarayanService->updateRoadObservedInfoByNikarayan($this->request, $this->roadObserved, $this->files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a job failure.
|
||||
*/
|
||||
public function failed(?Throwable $exception): void
|
||||
{
|
||||
NikarayanFault::query()->create([
|
||||
'road_observed_id' => $this->roadObserved->id,
|
||||
'response' => $exception->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user