I have the class but I get an error, why?
As you can see it:
Because you didn't run composer dumpauto command after you ran migrate command.
If you receive a "class not found" error when running migrations, try running the composer dump-autoload command and re-issuing the migrate command.
https://laravel.com/docs/5.2/migrations#running-migrations
Related
I just cloned a git repo and ran the necessary commands to install the project.
When I access the login page "http://localhost:80/nova/login" it works. However after enter the correct credentials and submit it shows an error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class '\App\User' not found
Do you know what can be the issue?
Also running this command:
/var/www # php artisan component:update
It shows a similar error:
Starting Update of All Component files
Symfony\Component\Debug\Exception\FatalThrowableError : Class 'App\Component' not found
After cloning, running through these steps should fix your problem:
run composer install or npm install.
check that the .env file is correct.
run php artisan key:generate
Optional: php artisan migrate
run php artisan serve
Reload composer autloaded classes.
composer dump-autoload
After lunching the command php artisan optimize , i got
fatal error: Uncaught ReflectionException: Class "env" does not exist
I have tried deleting the bootstrap/cache/ and runing composer update but nothing works,
everytime i tried to run a php artisan command/composer command i got the same problem. am really stuck. any help.
You can clear cache using:
php artisan optimize:clear
Or only clear config cache using:
php artisan config:clear
https://dev.to/kenfai/laravel-artisan-cache-commands-explained-41e1
Maybe you have something wrong in your config/database.php file. If it is the case when you run composer update the console will show some error at the end of execution due the config/database.php file
I followed the following instructions:
First, I ran:
composer create-project --prefer-dist laravel/laravel laravelLTE
cd laravelLTE
php artisan migrate
...which results in the following error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'App\Providers\Schema' not found
Then, I modified laravel/app/Providers/AppServiceProvider.php and retried php artisan migrate, but I see the same error as above.
Next, I tried installing the LTE admin template package:
composer global require "acacha/admin-lte-template-laravel:4.*"
...and then added: Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider::class and 'AdminLTE' => Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::class to the 'providers' and 'aliases' arrays in config/app.php.
After running, composer update, I see the same error as above, followed by this error:
Script php artisan optimize handling the post-update-cmd event returned with error code 255
Finally, I ran this command:
php artisan vendor:publish --tag=adminlte -force
...which results in this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider' not found
What am I doing wrong? I am using Laravel 5.4.36 and PHP 5.6.25.
Also, I am having a problem setting the domain or URL to e.g. laravel.dev.
Go to App\Providers and In the AppServiceProvider.php, you did not include the necessary use statement at the top of the file.
use Illuminate\Support\Facades\Schema;
That defines the namespace path to the Schema class so you can simply call
Schema::defaultStringLength(191);
in the boot method.
composer install --no-interaction --no-dev --prefer-dist
I try to deploy my app on DigitalOcean server, got error when executing above command.
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Broadcasting\BroadcastServiceProvider' not found
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
Other details listed below:
I use Laravel 5.2 and I created database tables by running
php artisan make:migration create_categories_table --create=categories
and
php artisan make:migration create_posts_table --create=posts
and then I run php artisan migrate, and tables are created in database. But after I made some changes in migration file "create_posts_table.php" and run
php artisan migrate:rollback
I got an error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'CreatePostsTable' not found
PHP Fatal error: Class 'CreatePostsTable' not found in E:\programfiles\xampp\htdocs\deneme\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php on line 336
my create_posts_table.php is
I tried composer update, composer dump-autoload but that hasn't fixed the problem.
I was getting the same problem. May this helps somebody: run composer dump-autoload before running migrate:rollback.
Before you run a migration, you should run the following commands to make sure cache has been cleared:
php artisan clear-compiled
php artisan optimize
This will make sure your new migration class has been registered correctly.