*/ protected $hidden = ['created_at', 'updated_at']; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'twofaccounts_count' => 'integer', ]; /** * The event map for the model. * * @var array */ protected $dispatchesEvents = [ 'deleting' => GroupDeleting::class, ]; /** * Override The "booting" method of the model * * @return void */ protected static function boot() { parent::boot(); static::deleted(function (object $model) { // @codeCoverageIgnoreStart Log::info(sprintf('Group %s deleted', var_export($model->name, true))); // @codeCoverageIgnoreEnd }); } /** * Get the TwoFAccounts of the group. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function twofaccounts() { return $this->hasMany(\App\Models\TwoFAccount::class); } }