spatie / laravel-permission

Associate users with roles and permissions
https://spatie.be/docs/laravel-permission
MIT License
12.12k stars 1.77k forks source link

Unable to Install Package #2695

Closed Dipesh79 closed 2 months ago

Dipesh79 commented 2 months ago

Description

The package is installed but go this error

composer dump-autoload
Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi

In UrlGenerator.php line 128:

Illuminate\Routing\UrlGenerator::__construct(): Argument #2 ($request) must be of type Illuminate\Http\Request, null given, called in /....../
/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 64

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Steps To Reproduce

  1. composer require spatie/laravel-permission ...

Example Application

No response

Version of spatie/laravel-permission package:

6.9

Version of laravel/framework package:

11.9

PHP version:

8.2

Database engine and version:

No response

OS: Windows/Mac/Linux version:

No response

Dipesh79 commented 2 months ago

I had used asset() helper inside a config file and i removed that and fixed my problem.