showBank($id); } /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit() { $bank = getActiveProfile(); // Verify this is a bank profile if (!($bank instanceof \App\Models\Bank)) { abort(403, 'Not a valid bank profile'); } // Verify the user can manage this bank $user = Auth::guard('web')->user(); if (!$user->banksManaged->contains($bank->id)) { abort(403, 'You do not have permission to edit this bank'); } return view('profile-bank.edit', [ 'bank' => $bank ]); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function settings() { return view('profile-bank.settings'); } }