jeudi 7 juillet 2016

How can I clear the cache in laravel using command line?

I have 3 environments running on the same web server i.e production, staging, development.

For each environment I set a different cache prefix to allow me to link the cache to different environment.

in the config/cache.php I changed

'prefix' => 'laravel',

to

'prefix' => ENV('CACHE_PREFIX', 'laravel'),

then in my .env file, I added the prefix for each enviornemnt like this

//For Dev
CACHE_PREFIX="LaravelDev"

//For Staging
CACHE_PREFIX="LaravelStaging"

//For Production 
CACHE_PREFIX="LaravelProduction"

I know I can clear the cache from the command line like this

php artisan cache:clear

but the code above will clear the cache for all of my environments.

I only want to clear the cache for "LaravelDev" only and leave alone "LaravelStaging" and "LaravelProduction"

How can I clear the cache for a specific environment?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire