芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/panorama.panoramawholesale.com/app/Notifications/Channel/AdminDatabaseChannel.php
<?php namespace App\Notifications\Channel; use App\Models\DatabaseNotification; use App\Models\User; use Illuminate\Notifications\Notification; use Illuminate\Support\Str; class AdminDatabaseChannel { /** * Notifiable type * * @var string */ private $notifiableType = User::class; /** * Send the given notification. */ public function send(object $notifiable, Notification $notification): void { if (! method_exists($notification, 'toAdmin')) { return; } $message = $notification->toAdmin($notifiable); $users = User::whereHas('roles', function ($query) { $query->where('slug', 'super-admin'); })->get(); $data = []; foreach ($users as $user) { $data[] = [ 'id' => Str::uuid()->toString(), 'type' => get_class($notification), 'notifiable_type' => $this->notifiableType, 'notifiable_id' => $user->id, 'data' => json_encode($message), 'read_at' => null, 'created_at' => now(), ]; } if (! empty($data)) { DatabaseNotification::insert($data); } } }
Page is not found
Oops! Page not found.
Sorry, an error has occured, Requested page not found!
Back To Homepage