public function __construct(array $attributes = []) { parent::__construct($attributes); if (empty($attributes['slug']) && !empty($attributes['name'])) { $attributes['slug'] = \Slugify::slugify($attributes['name']); } }