ldc-gen-game-web/app/Traits/Models/HasActivityLog.php
2026-10-20 12:27:49 +02:00

21 lines
489 B
PHP

<?php
declare(strict_types=1);
namespace App\Traits\Models;
use App\Observers\ModelObserver;
/**
* If there is a static function in a trait (named boot[TraitName]),
* it will be executed as the boot() function would on an Eloquent model.
* Futhermore, event in the Model observer doesn't erase actual events in the model,
* but adds them.
*/
trait HasActivityLog
{
public static function bootHasActivityLog(): void
{
static::observe(ModelObserver::class);
}
}