/** * Display a listing of the resource. * * @return Response */ public function index() { $users = User::paginate(15); $assigns = assign::get(); return view('user.index', compact('users', 'assigns')); }
public function assignclient($id) { $selected_coach = User::where('id', '=', $id)->get(); dd($selected_coach); $users = User::where('role', '=', 3)->get(); $assigns = assign::get(); foreach ($users as $user) { foreach ($assigns as $assign) { dd($assign); } } return view('assign.client', compact('users', 'selected_coach')); }