Aaron
Aaron

Reputation: 83

Laravel Keep caching though cleared

I have an annoying problem on Laravel, Though I clear all cached it's still caching. I've try to rename routes as like :

Route::get('/damn', function () {
    dd(1);
});

it's should show me 1 but I when I try to check on browser the web still show me the normal view.

I was try with

php artisan config:cache  

php artisan route:cache  

php artisan cache:clear

and It's keep caching till I run

php artisan optimize

when I edited the route again , It's caching again and again and always must to run artisan optimize

Anyone can help me out ?

Upvotes: 0

Views: 693

Answers (2)

Thai Nguyen Hung
Thai Nguyen Hung

Reputation: 1212

Maybe have another route with the same uri and it returns a view.

Upvotes: 0

Jayshri Ghoniya
Jayshri Ghoniya

Reputation: 266

You can simply place the below code in your routes/web.php file of Laravel application. Then access this URL in the browser to clear the cache of Laravel application.

Route::get('/clear-cache', function() {
    Artisan::call('cache:clear');
    return "Cache is cleared";
});

Upvotes: 2

Related Questions