예제 #1
0
파일: Node.php 프로젝트: jay4497/j4cms
 public static function boot()
 {
     parent::boot();
     static::updated(function ($node) {
         \Event::fire(new NodeUpdated($node));
     });
 }
예제 #2
0
파일: Karma.php 프로젝트: Dualse/GitterBot
 /**
  * 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]);
     });
 }
예제 #3
0
 /**
  * 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;
     });
 }