public static function boot() { parent::boot(); static::creating(function ($model) { $model->beforeCreate(); }); }
public static function boot() { parent::boot(); static::saving(function ($instance) { $instance->beforeSave(); }); }
public function toArray() { $arr = parent::toArray(); $arr['keys'] = $this->keys->toArray(); return $arr; }
public function __call($method, $parameters) { // get requested relationship, or use parent function return Relationship::getRelation($this, $method) ?: parent::__call($method, $parameters); }
public function toArray() { $arr = parent::toArray(); $arr['command'] = $this->getCommand(); return $arr; }