Пример #1
0
 public function index(Request $request)
 {
     $calling = CallingLog::orderBy('id', 'desc');
     if ($request->has('state')) {
         $calling = $calling->where('state', $request->input('state'));
     } elseif ($request->has('user_id')) {
         $calling = $calling->where('id', $request->input('user_id'));
     }
     $calling = $calling->paginate(20);
     $codes = CallingLog::pluck('user_id', 'id')->toArray();
     return view('callinglog::index', compact('calling', 'codes'));
 }