middleware(['auth', 'verified', 'onboarding', 'role:manager']); } public function index() { $artists = Artist::where('manager_id', Auth::id())->get(); return view('web.manager.artists') ->with('artists', $artists); } /** * Display the specified resource. * * @param int $id * @return Responsе|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\never */ public function show($username) { $user = User::where('username', $username)->firstOrFail(); if (Auth::id() === $user->id) { $managerProfile = Manager::with('user') ->whereHas('user', function ($query) use ($username) { return $query->where('username', '=', $username); })->firstOrFail(); return view('web.manager.profile') ->with('manager', $managerProfile); } return abort(404); } }