/** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { $notification = Notification::find($this->route()->parameter('id')); return $this->user()->id == $notification->user_id; }
public function unsee(NotificationRequest $request, $id) { $notification = Notification::find($id); $notification->unsee(); return "ok"; }