Edit File: NewJoinierRequestNotify.php
<?php namespace App\Jobs; use App\Models\Admin; use App\Notifications\NotifyUser; use App\Notifications\NotifyUser as Notify; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldBeUnique; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Notification; use Auth; class NewJoinierRequestNotify implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; /** * Create a new job instance. * * @return void */ protected $data; public function __construct($request , $type) { $user = Auth::user(); $this->data = [ 'sender' => auth()->id(), 'sender_name' => 'طلب انضمام', 'sender_avatar' => auth()->user()->AvatarPath, 'title_ar' => 'لديك طلب انضمام جديد', 'title_en' => 'you have a new join request', 'message_ar' => 'عرض طلب الانضمام', 'message_en' => 'you have a new join request', 'order_status' => 'open', 'owner_id' => $request->user_id ?? "", 'request_id' => $request->id , 'type' => $type, ]; } /** * Execute the job. * * @return void */ public function handle() { $admins = Admin::all(); Notification::send($admins, new NotifyUser($this->data)); } }
Back to File Manager