error creating migration in laravel: ‘failed to open stream’

I get this error on regular basis, here are some things that might help:

php artisan cache:clear

or delete the cache manually in the bootstrap directory (it is responsible for the route and services cache.

also these methods could help:

composer dump-autoload -o
composer update

Composer dump-autoload regenerates the list of all classes that need to be included in the project (autoload_classmap.php).

the -o / –optimize option converts PSR-4/PSR-0 rules into classmap rules, as a result autoloader doesn’t need to access the filesystem, making it run faster – which also is often the source of the problem since Laravel autoloader uses this optimization (caching).

also rolling back the migration has helped to solve the problem several times (if the migration was successful):

php artisan migrate:rollback

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)