How to clear bootstrap Laravel cache configuration file?

I developed the laravel application locally and uploaded it to shared hosting.

During hosting, I changed the database name and mysql username in the .env files and the config / database file.

But in the remote state, the old db name and user, which is in the bootstrap / cache / config file, are still used.

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

+9
source share
7 answers

Use php artisan cache:clearto clear application cache.

+7
source

If you are trying to clear the configuration cache that sounds like you. You need to run:

php artisan config:clear

- , , php artisan config:cache, , php artisan cache:clear

+30

, .

bootstrap/cache/config.php. . Ultimate .

+7

:

Laravel 4: php artisan cache:clear

laravel 5 ( ),

Illuminate\Cache\FileStore flush

Cache::flush();

use Doctrine\Common\Cache\CacheProvider as DoctrineCache;

DoctrineCache::flushAll();
+3
php artisan config:clear

bootstrap/config.php, .

: vendor\laravel\framework\src\Illuminate\Foundation\Console\ConfigClearCommand.php

+3

AWS. Laravel , . , , , , , , - , , . :

1)

php artisan cache:clear

2)

rm -fr bootstrap/cache/*

, , , .

php artisan optimize
+2

,

    • php artisan cache:clear, , php artisan cache:forget, .
    • php artisan config:clear .
  1. php artisan view:clear .

  2. , php artisan optimize:clear.

  3. php artisan route:clear.

  4. php artisan event:clear

if you are still stuck in finding useful commands, you can run php artisan listit and it will list each command with its description. Search for the specific thing you want to accomplish. if you need a team related to migration, you can look at migration.

+1
source

Source: https://habr.com/ru/post/1616699/