[ad_1]
In this Laravel code I am trying to use same return route twice, but the second one is not working for some reason.
My controller
public function getTransfers($account_id)
{
//Passing user id into find()
$transfers = Account::find($account_id)->transfers;
return view('account.index', compact('transfers'));
}
public function getTransfers2($account_id)
{
//Passing user id into find()
$accounts = Account::find($account_id)->accounts;
return view('account.index', compact('accounts'));
}
My route
Route::get('/account/{id}', [bankController::class, 'getTransfers']);
Route::get('/account/{id}', [bankController::class, 'getTransfers2']);
[ad_2]