'string', ]; /** * The fillable properties. * * @var string[] */ protected $fillable = ['name']; /** * Overrides the models boot method. * * @return void */ public static function boot() { parent::boot(); self::creating(function ($tag) { $tag->slug = Str::slug($tag->name); }); } /** * Get the components relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function components() { return $this->belongsToMany(Component::class); } }