Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel php artisan produces error

Tags:

I have integrated and working in a Laravel 5.4 project. I was actually configure this correctly and php artisan command was working perfectly before.But in between the development time(I have implemented the schedule task using laravel and not sure after that issue appear) it produces m error on php artisan commands. Can anybody help me on this.

The following is the error log for the command for any artisan command

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /var/www/html/project/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 60 in /var/www/html/project/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:103

Stack trace:
#0 /var/www/html/projrct/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php(60):

Illuminate\Routing\UrlGenerator->__construct(Object(Illuminate\Routing\RouteCollection), NULL) #1 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(290): Illuminate\Routing\RoutingServiceProvider->Illuminate\Routing{closure}(Object(Illuminate\Foundation\Application)) #2 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(746): Illuminate\Container\Container->Illuminate\Container{closur in /var/www/html/project/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 103

like image 402
anoop Avatar asked Jul 17 '17 19:07

anoop


People also ask

Why php artisan serve not working?

Reasons why php artisan serve not working You are running php artisan serve command in wrong directory. php artisan serve is laravel command only work with laravel project. Check project directory and run in root directory of your project. The requested host or port is not available.

How do I disable error reporting in laravel?

You may turn off error details by setting the debug option in your app/config/app. php file to false .

Can php artisan serve?

The Laravel PHP artisan serve command helps running applications on the PHP development server. As a developer, you can use Laravel artisan serve to develop and test various functions within the application. It also accepts two additional options. You can use the host for changing application's address and port.

What is laravel php artisan?

Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application. It is driven by the powerful Symfony Console component.


2 Answers

Please make sure that you are not using any url() or asset() or other helpers functions inside your configuration files

like image 107
Ahmed Abu Eldahab Avatar answered Sep 24 '22 11:09

Ahmed Abu Eldahab


I my case url() helper function in my filesystem.php is causing the issue. I removed it and every thing works fine.

like image 33
Awais Jameel Avatar answered Sep 23 '22 11:09

Awais Jameel