/** * Overwrite parents create to set a default approval state. * * @param static */ public static function create(array $attributes = []) { if (!array_key_exists('approved', $attributes)) { $attributes['approved'] = config('kurt_modules.blog.preapproved_comments'); } return parent::create($attributes); }
/** * The "booting" method of the model. * * @return void */ public static function boot() { parent::boot(); self::observe(new TagObserver()); }