how to clean Laravel Bootstrap cache config file?

2020-05-26 06:12发布

I developed laravel app locally and uploaded in shared hosting.

While hosting I changed the database name and username of mysql in the .env and the config/database files.

But in remote its still using the old db name and user which is found in the bootstrap/cache/config file.

So how to clean the bootstrap/cache/config.php file?

8条回答
闹够了就滚
2楼-- · 2020-05-26 06:42

The solution for me was to remove the files in the bootstrap/cache/ directory and then delete the vendor folder. Re-run composer install and then composer dump-autoload and the above campaigns should run fine. Deleting the vendor folder and re-running composer install was the missing link for me

查看更多
戒情不戒烟
3楼-- · 2020-05-26 06:45

Here is the Tip,

  1. Flushing Application cache

    • Use php artisan cache:clear to flush the application cache or php artisan cache:forget to discard specific cache.
    • You can use php artisan config:clear to clear cached configuration of application.
  2. Removing Blade Templates cache

    You can use php artisan view:clear to clear all compiled views.

  3. Application Bootstrap cache

    If you want to clear the application bootstraper cache, php artisan optimize:clear will help you.

  4. Route Cache

    There also a command to clear the route cache as php artisan route:clear.

  5. Events and Listeners cache

    For events and listeners cache you can use php artisan event:clear

if you still stuck in finding helpful commands, you can run php artisan list and it will list out every command with its description. look for a specific thing you want to perform. if you need migration-related command, you can look in migration.

查看更多
登录 后发表回答