I found no error on my router. but when running an error occurs. what's wrong with my router?
MY router
<?php
use App\Http\Controllers\{HomeController, DashboardController};
use Illuminate\Support\Facades\{Route, Auth};
Auth::routes();
Route::get( uri: '/', action: HomeController::class)->name(name: 'home');
Route::middleware( middleware: 'auth')->group( callback: function () {
Route::get( uri: 'dashboard', action: DashboardController::class)->name(name: 'dashboard');
});
the error message is like this. It's the first time I've come across an error like this, and I looked it up but I couldn't find the same article.
ErrorException
Undefined array key 0
at vendor/laravel/framework/src/Illuminate/Routing/Router.php:1325
1321▕ return $this->macroCall($method, $parameters);
1322▕ }
1323▕
1324▕ if ($method === 'middleware') {
➜ 1325▕ return (new RouteRegistrar($this))->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters);
1326▕ }
1327▕
1328▕ return (new RouteRegistrar($this))->attribute($method, $parameters[0]);
1329▕ }
+2 vendor frames
3 routes/web.php:11
Illuminate\Support\Facades\Facade::__callStatic()
+4 vendor frames
8 app/Providers/RouteServiceProvider.php:48
Illuminate\Routing\RouteRegistrar::group()