Laravel 5 - Clear cache in shared hosting server

2019-01-07 04:56发布

The question is pretty clear.

php artisan cache:clear

Is there any work around to clear the cache like above we using in CLI. I am using a famous shared hosting service but as per my plan I don't have control panel access.

Basically I want to clear the views cache.

I saw a question almost same like this, but it doesn't helps me.

Thanks in advance.

14条回答
Summer. ? 凉城
2楼-- · 2019-01-07 05:33
php artisan view:clear

will clear the cached views

查看更多
太酷不给撩
3楼-- · 2019-01-07 05:34

You can do this if you are using Lumen from Laravel on your routes/web.php file:

use Illuminate\Support\Facades\Artisan;

$app->get('/clear-cache', function () {
    $code = Artisan::call('cache:clear');
    return 'cache cleared';
});
查看更多
登录 后发表回答