'team'], function () { Route::get('/', [TeamsController::class, 'index'])->middleware('auth')->name('index') ; Route::get('/create', [TeamsController::class, 'create'])->middleware('auth')->name('create') ; Route::post('/', [TeamsController::class, 'store'])->middleware('auth')->name('store') ; Route::get('/{team}', [TeamsController::class, 'show'])->middleware('auth')->name('show') ; Route::get('/{team}/edit', [TeamsController::class, 'edit'])->middleware('auth')->name('edit') ; Route::put('/{team}', [TeamsController::class, 'update'])->middleware('auth')->name('update') ; Route::delete('/{team}', [TeamsController::class, 'destroy'])->middleware('auth')->name('destroy') ; }) ; }); // Instead do thi s Route::get('teams', [TeamsController::class, 'index'])->name('teams.index') ; Route::middleware('auth')->group(function () { Route::get('teams/create', [TeamsController::class, 'create'])->name('teams.create') ; Route::post('teams', [TeamsController::class, 'store'])->name('teams.store') ; Route::get('teams/{team}', [TeamsController::class, 'show'])->name('teams.show') ; Route::get('teams/{team}/edit', [TeamsController::class, 'edit'])->name('teams.edit') ; Route::put('teams/{team}', [TeamsController::class, 'update'])->name('teams.update') ; Route::delete('teams/{team}', [TeamsController::class, 'destroy'])->name('teams.destroy') ; });