'required|unique:component_groups', ]; /** * The fillable properties. * * @var string[] */ protected $fillable = ['name', 'order']; /** * A group can have many components. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function components() { return $this->hasMany(Component::class, 'group_id', 'id'); } }