function index() { $notifications = Notification::where('user_id', Auth::user()->id)->paginate(8); return view('back.notification', compact('notifications')); }
public function compose(View $view) { $notify['count'] = Notification::whereRaw('isOpen = 0 and user_id = ' . Auth::user()->id)->count(); $notify['notifications'] = Notification::where('user_id', Auth::user()->id)->take(10)->get(); $view->with('notify', $notify); }