I am new to Laravel. I am trying to clear view cache, and I need to clear view cache without composer.
Is possible to clear cache using composer.json autoload
?
I have already tried the code below, but it was not working.
routes.php
Route::get('/view-clear', function() {
$exitCode = Artisan::call('view:clear');
return '<h1>View cache cleared</h1>';
});
Also, how should I use...
Cache::flush();
...in my code controller.
With a Filemanager or a Simple PHP Code Delete the compiled views inside of storage\framework\views
Example:
Route::get('/view-clear', function() {
$directory=storage_path('framework/views');
$files=File::allFiles($directory);
File::delete($files);
return '<h1>View cache cleared</h1>';
});
May be something like this?
public function index()
{
$value = Cache::flush();
return view('your.view')->with($value);
}
Why not try clear browser cache ?
I think the view cache saved by browser.