/** * @param int $userId * @return \Illuminate\View\View */ public function index($userId) { $user = User::with('horses')->where('id', $userId)->firstOrFail(); return view('horses.index', compact('user')); }