13

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

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
  • this is probably a consequence of something else which is unclear here. This error happens when the request object is not bound which should only ever happen if the Kernel was not booted and hasn't invoked the router correctly. I'm afraid you have to do a rather deep dive in your code to investigate what might be happening – apokryfos Jun 06 '22 at 16:10
  • There must be a problem with your routes, review them. Btw you can clear cache routes to get a refresh on cache. running `php artisan route:clear` – Manuel Glez Jun 06 '22 at 16:43
  • @ManuelGlez any artisan command gives error in this case, so `route:clear` will never work. – Astro Jun 29 '22 at 16:03
  • 1
    You're right @Astro – Manuel Glez Jun 29 '22 at 17:52

3 Answers3

40

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.

Zacktamondo
  • 1,891
  • 3
  • 17
  • 33
M.Haris
  • 451
  • 4
  • 5
12

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.

Astro
  • 641
  • 2
  • 6
  • 13
4

I solved this issue by changing this line:

asset('img/order_system/shopify.png')

to

'/img/order_system/shopify.png'

in config.

Zahid
  • 470
  • 1
  • 3
  • 15