Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert Laravel app.name

I wanted to change the app.name of my Laravel project, the new name had a space in it. Since the change of the name I get the PHP error:

PHP Fatal error: Uncaught ReflectionException: Class App\Console\Kernel does not exist in D:\xampp\htdocs\sistemas\selecao-geral\vendor\laravel\framework\src\Illuminate\Container\ Container.php:752

I now wish to revert the name back but this fails due too the above stated error.

How can I change back the app name, could I maybe do this manually?

like image 544
Patrick Pierre Avatar asked Feb 15 '18 12:02

Patrick Pierre


2 Answers

Put the name in "quotes":

APP_NAME="Your App's Name"

And run:

php artisan config:clear

to clear the config cache.

like image 76
Sapnesh Naik Avatar answered Oct 10 '22 08:10

Sapnesh Naik


Just ran into this problem today and I was able to fix it using these steps. Take note that this problem occurred because I've accidentally set the application "namespace" using the artisan command

php artisan app:name

instead of using the env variable APP_NAME to set the application name only

  • Using your IDE(in my case I'm using SublimeText3) search for the app namespace you've set (in my case I've set my namespace to TestApp) for all files inside your project. Make sure you match the whole word to be sure.

  • Replace the namespace to App (TestApp to App)

  • Finally after saving all files with the replaced namespace run composer dump-autoload
like image 39
Francis Pineda Avatar answered Oct 10 '22 08:10

Francis Pineda