protected function notification($event, $action, $is_visible = false) { $actorName = is_string($event->actor) ? $event->actor : $event->actor->name; $actorId = is_string($event->actor) ? null : $event->actor->id; $actorRole = is_string($event->actor) ? 'system' : $event->actor->role->name; Notification::create(['actor_name' => $actorName, 'actor_id' => $actorId, 'actor_role' => $actorRole, 'notified_name' => $event->adtype->title, 'notified_id' => $event->adtype->id, 'data' => $event->order->quantity, 'action' => $action, 'type' => 'adtype', 'is_visible' => $is_visible]); }
/** * Run the database seeds. * * @return void */ public function run() { Notification::create(['actor_name' => 'ZEDx', 'actor_id' => null, 'actor_role' => 'system', 'notified_name' => 'Création du site par [ ZEDx ].', 'notified_id' => null, 'action' => 'create', 'type' => 'website', 'is_visible' => 1]); }
protected function notification($event, $action, $is_visible = false) { Notification::create(['actor_name' => $this->actorName, 'actor_id' => $this->actorId, 'actor_role' => $this->actorRole, 'notified_name' => $event->subscription->title, 'notified_id' => $event->subscription->id, 'action' => $action, 'type' => 'subscription', 'is_visible' => $is_visible]); }