Beispiel #1
0
 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]);
 }
Beispiel #2
0
 /**
  * Mark all notifications as read.
  *
  * @param Request $request
  *
  * @return Reponse
  */
 public function readall(Request $request)
 {
     if (\Request::ajax()) {
         return ['success' => (bool) Notification::readall()];
     } else {
         abort(404);
     }
 }
Beispiel #3
0
 /**
  * Display widget.
  *
  * @return Response
  */
 public function run()
 {
     return view('widget_backend_zedx_latestnotifications::index', ['config' => $this->config, 'currency' => setting('currency'), 'notifications' => Notification::visible()->recents()->limit(6)->get()]);
 }
Beispiel #4
0
 /**
  * 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]);
 }