php artisan clear cache

Today, We want to share with you php artisan clear cache.In this post we will show you Clearing the Config Cache, hear for laravel delete cache files manually we will give you demo and example for implement.In this post, we will learn about laravel clear cache without artisan with an example.

Here is list of commands that will help you to cache clear: php artisan clear cache

We are ref. for cache clear: Cache – Laravel – The PHP Framework For Web Artisans

php artisan clear cache

There are the Following The simple About laravel clear cache command line Full Information With Example and source code.

Read Also:  Laravel 6 Insert Update and Delete record from MySQL

As I will cover this Post with live Working example to develop laravel clear cache/config, so the laravel 6 artisan optimize class is used for this example is following below.

How To Clearing Cache In Laravel?

you are using Lumen from Laravel on your routes/web.php file:

added in Top of web.php

use Illuminate\Support\Facades\Artisan;

Clearing Cache facade value:

Route::get('/clearing-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    return '<h1>Cache facade value cleared</h1>';
});

Reoptimized class loader:

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

Route cache:

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

Clearing Route cache:

Route::get('/route-clearing', function() {
    $exitCode = Artisan::call('route:clear');
    return '<h1>Route cache cleared</h1>';
});

Clearing View cache:

Route::get('/view-clearing', function() {
    $exitCode = Artisan::call('view:clear');
    return '<h1>View cache cleared</h1>';
});

Clearing Config cache:

Route::get('/config-cache', function() {
    $exitCode = Artisan::call('config:cache');
    return '<h1>Clearing Config cleared</h1>';
});

Web Programming Tutorials Example with Demo

Read :

Read Also:  Vue JS Axios Post Request using Laravel Example

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel 7.x and 6.x Clear Cache Using Artisan Command.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.