What is MVC architecture?
MVC or Model-View-Controller architecture is a design pattern used to develop web applications. This model consists of
How to clear or recreate Laravel website cache, root, and config through site address. People who have experience working
How to clear or recreate Laravel website cache, root, and config through site address. People who have experience working with Laravel know that the commands are executed through artisan, but this is when your framework is not on the host and you can apply the commands through the command environment.
Now suppose we uploaded the site and wanted to cache it, what should we do?
Be careful, even if we cache the site with artisan, we must empty the cache after loading.
In any case, if we want to use the cache feature for different parts of Laravel, we need to enter the commands through the site address, but how?
First, enter the Routes folder in Laravel and edit the web file. We include all the code snippets you need below. At first, we put the cleaning method of each one.
Clearing Laravel cache via site address
//Clear Cache facade value: Route::get('/clear-cache', function() { $exitCode = Artisan::call('cache:clear'); return '<h1>Cache facade value cleared</h1>'; }); /Clear Route cache: Route::get('/route-clear', function() { $exitCode = Artisan::call('route:clear'); return '<h1>Route cache cleared</h1>'; }); //Clear View cache: Route::get('/view-clear', function() { $exitCode = Artisan::call('view:clear'); return '<h1>View cache cleared</h1>'; }); //Clear Config cache: Route::get('/config-cache', function() { $exitCode = Artisan::call('config:cache'); return '<h1>Clear Config cleared</h1>'; });
Laravel cache via site address
/Cache route: Route::get('/route-clear', function() { $exitCode = Artisan::call('route:cache'); return '<h1>Route cache</h1>'; }); //View cache: Route::get('/view-clear', function() { $exitCode = Artisan::call('view:cache'); return '<h1>View cache</h1>'; }); //Config cache: Route::get('/config-cache', function() { $exitCode = Artisan::call('config:cache'); return '<h1>Config cache</h1>'; });
Additional explanations :
To cache different parts through artisan, the following codes are used:
php artisan optimize php artisan config:cache php artisan config:clear php artisan route:cache php artisan route:clear php artisan view:cache php artisan view:clear
Source » Itroz Academy
XAMPP is a powerful web development tool that allows developers to create dynamic and interactive websites.
MVC or Model-View-Controller architecture is a design pattern used to develop web applications. This model consists of
How to create an image with artificial intelligence (AI) has become a household word in recent years, with applications
One of the most common and frustrating problems faced by WordPress users is the White Screen of Death (WSOD).
Comments (0)