• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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