How to flush Laravel cache before saving the Model

Categorized as Laravel Tagged

You can make some improvement to your code, if you want to reset the cache on creating or updating a Model in Laravel. See the code below:

class Post extends Model 
  public static function boot()

    static::saving(function () {

Leave a reply

Your email address will not be published. Required fields are marked *