public static function boot() { parent::boot(); static::updated(function ($node) { \Event::fire(new NodeUpdated($node)); }); }
/** * Boot */ public static function boot() { parent::boot(); static::creating(function (Karma $karma) { if (!$karma->created_at) { $karma->created_at = $karma->freshTimestamp(); } \Event::fire('karma.add', ['karma' => $karma]); }); }
/** * Boot */ public static function boot() { parent::boot(); static::creating(function (Achieve $achieve) { if (!$achieve->created_at) { $achieve->created_at = $achieve->freshTimestamp(); } if (static::has($achieve->user, $achieve->name)) { return false; } \Event::fire('achieve.add', ['achieve' => $achieve]); return null; }); }