for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace RichanFongdasen\Varnishable\Model\Concerns;
use RichanFongdasen\Varnishable\VarnishableObserver;
trait Varnishable
{
/**
* Boot the Varnishable trait by attaching
* a new observer to the current model.
*
* @return void
*/
public static function bootVarnishable(): void
static::observe(app(VarnishableObserver::class));
}
* When a model is being unserialized, fire eloquent wakeup event.
public function __wakeup(): void
parent::__wakeup();
event('eloquent.wakeup: '.get_class($this), $this);