| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Jobs;
- use App\Models\Order;
- use App\Notifications\FireBaseNotification;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Queue\Queueable;
- class NotifyManagerChangeStatusJob implements ShouldQueue
- {
- use Queueable;
- /**
- * Create a new job instance.
- */
- public function __construct( private readonly Order $order )
- {}
- /**
- * Execute the job.
- */
- public function handle(): void
- {
- $title = 'Изменён статус площадки';
- $body = 'Площадка ' . $this->order->common_name . '. Статус: ' . $this->order->orderStatus->name;
- if(!is_null($this->order->user->token_fcm)) {
- $this->order->user->notify(new FireBaseNotification($title, $body));
- }
- }
- }
|