keevitaja - 1 year ago

Hi! Is there an easy way to flush the cache when admin updates/creates/deletes something in the admin section?

If not, then how do i flush the cache, when admin modifies file/post/page/navigation including the repeaters and custom fields?

Thanks a lot for the help!

mattcdavis1 - 1 year ago

Listening for the eloquent saved event should capture most updates although not all (i have a ticket open for this here:

As far as clearing the cache, that's just something like the below (i use this when deploying new code):

<?php namespace Union\AppModule\Http\Controller;

use Illuminate\Cache\CacheManager;

class UtilController extends PublicController
    protected $excludedMiddleware = [

    public function deploy(CacheManager $cache)


keevitaja - 1 year ago

yeah, that is one option

        \Event::listen('eloquent.saved: *', function($event) {

But it would be nicer to target a specific module(s).

@mattcdavis1 what happens to opcache_reset(); when opcache is not installed?