| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Jobs;
- use App\DeliveryAppointment;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Queue\SerializesModels;
- class DeliveryAppointmentCheck implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- protected $int;
- /**
- * Create a new job instance.
- *
- * @param int $int
- *
- * @return void
- */
- public function __construct(int $int)
- {
- $this->int = $int;
- }
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- /** @var DeliveryAppointment|\stdClass $appointment */
- $appointment = DeliveryAppointment::query()->find($this->int);
- if ($appointment && $appointment->status!=2)$appointment->update(["status"=>3]);
- }
- }
|