cache in laravel code example

Example 1: laravel clear cache

php artisan cache:clear
php artisan route:clear
php artisan config:clear 
php artisan view:clear

Example 2: limpiar cache en laravel

php artisan cache:clear
php artisan config:clear
php artisan config:cache

Example 3: clear all laravel cache

/**[SAFE] Clears all cache with 1 line!**/ 
php artisan route:clear &&  
php artisan view:clear && 
php artisan config:clear &&
php artisan cache:clear && 
php artisan clear-compiled

Example 4: cache clear in laravel

php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache

Example 5: laravel clear cache

//Laravel 7 / 2021-01
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan optimize

Example 6: why the laravel project have many cache

1 _  go to app/console/Kernel.php
2 _ do everything that you want in schedule like this : 

protected function schedule(Schedule $schedule)
    {
        $schedule->call(function () {
            DB::table('recent_users')->delete();
        })->daily();
    }

Tags:

Php Example