'integer', ]; /** * Override The "booting" method of the model * * @return void */ protected static function boot() { parent::boot(); static::deleting(function ($model) { TwoFAccount::where('group_id', $model->id) ->update( ['group_id' => NULL] ); }); static::deleted(function ($model) { Log::info(sprintf('Group %s deleted', var_export($model->name, true))); }); } /** * Get the TwoFAccounts of the group. */ public function twofaccounts() { return $this->hasMany('App\TwoFAccount'); } }