I am a beginner in this, please bear with me. I want to run a driving school system on local host xampp, but i am getting this error when i am trying to load the page:
Fatal error: Cannot use lexical variable $router as a parameter name in C:\xampp\htdocs\driving\src\routes.php on line 22
Code snippet:
Router::group(function ($router) use ($router) {
$router->exceptionHandler(Handler::class);
Router::group(function ($differentVariableName) use ($router) {
$innerRouter = $router; // Assign the value of $router to $innerRouter
$innerRouter->middleware(Simcify\Middleware\Authenticate::class);
});
});
I tried to change the parameter name, but still getting the same error. Please assist. Thank you in advance
Fatal error: Cannot use lexical variable $router as a parameter name in C:\xampp\htdocs\driving\src\routes.php on line 22
Code snippet:
Router::group(function ($router) use ($router) {
$router->exceptionHandler(Handler::class);
Router::group(function ($differentVariableName) use ($router) {
$innerRouter = $router; // Assign the value of $router to $innerRouter
$innerRouter->middleware(Simcify\Middleware\Authenticate::class);
});
});
I tried to change the parameter name, but still getting the same error. Please assist. Thank you in advance