Laravel cache issue 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: clear laravel cache

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

Example 3: laravel fix cache

php artisan cache:clear

Example 4: 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();
    }

Example 5: how to manually remove cache in laravel

//You can call an Artisan command outside the CLI.

Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    // return what you want
});

Tags:

Misc Example