📜  通过路由 laravel 清除缓存 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:31.355000             🧑  作者: Mango

代码示例2
//Clear Cache facade value:
Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    return '

Cache facade value cleared

'; }); //Reoptimized class loader: Route::get('/optimize', function() { $exitCode = Artisan::call('optimize'); return '

Reoptimized class loader

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

Routes cached

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

Route cache cleared

'; }); //Clear View cache: Route::get('/view-clear', function() { $exitCode = Artisan::call('view:clear'); return '

View cache cleared

'; }); //Clear Config cache: Route::get('/config-cache', function() { $exitCode = Artisan::call('config:cache'); return '

Clear Config cleared

'; });