示例#1
0
 public function notifications()
 {
     if (!isset($this->notifications)) {
         $this->notifications = Notification::forUser($this->id);
     }
     return $this->notifications;
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $notification = Notification::findOrNew($id);
     $notification->is_read = 1;
     $notification->save();
     return redirect()->back();
 }
 public function clearNotifications(Request $request, Session $session)
 {
     if (!$session->userIsLoggedIn()) {
         return $this->redirectTo('/login');
     }
     Notification::clearForUser($session->activeUser()->id);
     return $this->redirectTo('/dashboard?message=' . urlencode('Notifications cleared'));
 }
示例#4
0
 /**
  * Send a user a forgot password reminder
  *
  * @param  array  $fields
  * @param  string $title
  * @return void
  */
 public function forgot(array $fields, $title)
 {
     $user = Table\Users::findBy(['email' => $fields['email']]);
     if (isset($user->id)) {
         $this->data['id'] = $user->id;
         $notify = new Notification();
         $notify->sendReset($user, $title);
     }
 }