Why is this error in laravel?

-1

I entered a YouTube channel where I am watching a video tutorial where I do the corresponding configuration of the frameworks but there is a step where you have to change the namespace of the frameworks with the pham artisan app: name sisventas, the command makes the change but execute the artisan serve generates the following error

  

PHP Fatal error: Uncaught exception 'ReflectionException' with   message 'Class App \ Console \ Kernel does not exist' in /var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Container/Container.php:729   Stack trace:

     

/var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Container/Container.php (729):   ReflectionClass-> __ construct ('App \ Console \ Ker ...')   /var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Container/Container.php(608):

     

Illuminate \ Container \ Container-> build ('App \ Console \ Ker ...')   /var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Container/Container.php(564):   Illuminate \ Container \ Container- > solve ('App \ Console \ Ker ...', Array)

     

/var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Foundation/Application.php (709):   Illuminate \ Container \ Container-> makeWith ('App \ Console \ Ker ...',   Array)

     

/var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Container/Container.php (248):   Illuminate \ Foundation \ Application->> makeWith ('App \ Console \ Ker ...',   Array) in   /var/www/html/sisventas/vendor/laravel/framework/src/Illuminate/Container/Container.php   online 729

I do not know if it is necessary to change the namespace of the frameworks and leave it by default

    
asked by JoSe Daniel Sanchez 28.10.2017 в 23:25
source

1 answer

1

There are several possible causes for this error message to be generated, normally it is related to the autoload, for which you can run the console composer du , although in theory the command you used also does it.

Another reason may be that you have changed the name of some folder, taking into account that the autoload is case-sensitive, example: app\Console is not the same as app\console .

Also check that the syntax is correct in bootstrap/app.php .

Finally, Laravel DO NOT CHANGE THE NAMESPACE of the application is widely advised in the world, this can lead to many future problems when maintaining and evolving the application, unless you are going to carry out a project macro that requires maintaining several namespaces to separate applications, custom packages and dependencies. I can attest to the problems of changing the default namespace in a not-so-big project.

If you really want to learn from Laravel, you can visit his documentation , Laracasts or Styde (in Spanish), YouTube is not a good advisor in this case.

    
answered by 29.10.2017 в 18:03