ERROR : syntax error, unexpected '$app' (T_VARIABLE), expecting ')'

๐Ÿ‘:0

The error is very clear, it tells you that you are missing one ) after your $app variable.

Try this :

public function register(): void { 
     $this->app->singleton(Registrar::class, fn(Application $app)) => new Registrar (
           //...
     ); 
}

Leave a comment