Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Illuminate\Routing\UrlGenerator::__construct(): Argument #2 ($request) must be of type Illuminate\Http\Request, null given

No command is working, I also tried to update Composer, but the case is the same. I found a guide that said to ignore the url() and asset() method, but it did not solve the issue.

Illuminate\Routing\UrlGenerator::__construct(): Argument #2 ($request) must be of type Illumina te\Http\Request, null given, called in D:\artyir\xampp8\htdocs\boilerplate\core\vendor\laravel\
framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 65

like image 687
Tufayal Hossin Avatar asked Dec 01 '25 03:12

Tufayal Hossin


2 Answers

I got that error message because I used url() in config folder. Try not to use any url() or asset() in the config folder mainly in app.php.

like image 159
M.Haris Avatar answered Dec 03 '25 23:12

M.Haris


I faced same problem when I used asset() function in some file in config folder, so try to remove any helper function from all config files, it prevents the loading of the app routes.

like image 40
Astro Avatar answered Dec 04 '25 00:12

Astro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!