Last active
February 26, 2024 02:18
-
-
Save donpandix/94bcc707fa226770be399563e2144ec1 to your computer and use it in GitHub Desktop.
Limpia caché en laravel con una llamada HTTP en Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Artisan; | |
// version optimizada de limpieza de cache | |
Route::get('/clear-cache', function () { | |
Artisan::call('optimize:clear'); | |
return '<script>window.location.href="/"</script>'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Artisan; | |
Route::get('/clear-cache', function () { | |
Artisan::call('cache:clear'); | |
Artisan::call('route:clear'); | |
Artisan::call('config:cache'); | |
Artisan::call('view:clear'); | |
// setea nuevamente el cache | |
Artisan::call('config:cache'); | |
Artisan::call('route:cache'); | |
Artisan::call('view:cache'); | |
return "Cache limpiado exitósamente"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment