• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question lexical error on routes.php

LesyReeds

New Pleskian
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
 
Back
Top