Добавив данный код в роутинг, можно будет отправлять post запрос для очистки кеша.
Route::post('/clear-cache', ['middleware' => ['auth', 'role:admin'], function () {
$cachedViewsDirectory = app('path.storage') . '/framework/views/';
if ($handle = opendir($cachedViewsDirectory)) {
while (false !== ($entry = readdir($handle))) {
if (strstr($entry, '..')) {
continue;
}
@unlink($cachedViewsDirectory . $entry);
}
closedir($handle);
}
return 1;
}]);