public function viewUser(Request $request, User $user) { $scripts = Script::where('user_id', $user->id)->get(); return view('admin.userView', ['user' => $user, 'scripts' => $scripts]); }
public function forUser(User $user) { return Script::where('user_id', $user->id)->orderBy('created_at', 'asc')->get(); }