芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/app/Http/Controllers/User/NotificationController.php
middleware('auth'); } public function user_notf_count() { $user = Auth::user(); $data = UserNotification::where('user_id','=',$user->id)->where('is_read','=',0)->get()->count(); return response()->json($data); } public function user_notf_clear() { $user = Auth::user(); $data = UserNotification::where('user_id','=',$user->id); $data->delete(); } public function user_notf_show() { $user = Auth::user(); $datas = UserNotification::where('user_id','=',$user->id)->get(); if($datas->count() > 0){ foreach($datas as $data){ $data->is_read = 1; $data->update(); } } return view('user.notification',compact('datas')); } }