/**
  * Handle the event.
  *
  * @param  UserRegistered  $event
  * @return void
  */
 public function handle(UserRegistered $event)
 {
     if (!Spark::trialDays()) {
         return;
     }
     $this->notifications->create($event->user, ['icon' => 'fa-clock-o', 'body' => 'Your trial period will expire on ' . $event->user->trial_ends_at->format('F jS') . '.', 'action_text' => 'Subscribe', 'action_url' => '/settings#/subscription']);
 }
 /**
  * Handle the event.
  *
  * @param  TeamCreated  $event
  * @return void
  */
 public function handle(TeamCreated $event)
 {
     if (!Spark::teamTrialDays()) {
         return;
     }
     $this->notifications->create($event->team->owner, ['icon' => 'fa-clock-o', 'body' => "The " . $event->team->name . " team's trial period will expire on " . $event->team->trial_ends_at->format('F jS') . '.', 'action_text' => 'Subscribe', 'action_url' => '/settings/teams/' . $event->team->id . '#/subscription']);
 }
 /**
  * Get the recent notifications and announcements for the user.
  *
  * @return Response
  */
 public function recent(Request $request)
 {
     return response()->json(['announcements' => $this->announcements->recent()->toArray(), 'notifications' => $this->notifications->recent($request->user())->toArray()]);
 }
 /**
  * Handle the event.
  *
  * @param  UserInvitedToTeam  $event
  * @return void
  */
 public function handle(UserInvitedToTeam $event)
 {
     $this->notifications->create($event->user, ['icon' => 'fa-users', 'body' => 'You have been invited to join the ' . $event->team->name . ' team!', 'action_text' => 'View Invitations', 'action_url' => '/settings#/teams']);
 }