Skip to content

Commit 90e27f7

Browse files
committed
fix: passing null tag type
1 parent c667f25 commit 90e27f7

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/Models/Tag.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ class Tag extends \Spatie\Tags\Tag implements Linkable, LocalizedUrlRoutable
2222
{
2323
public array $translatable = ['name', 'slug', 'seo_description'];
2424

25-
// set type to default if not filled in:
26-
protected $attributes = [
27-
'type' => TagType::TYPE_DEFAULT,
28-
];
29-
3025
public function getTable()
3126
{
3227
return FilamentFlexibleContentBlockPages::config()->getTagsTable();

src/Models/TagType.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class TagType extends Model
2222
{
2323
use HasTranslations;
2424

25-
const TYPE_DEFAULT = 'default';
25+
public const TYPE_DEFAULT = 'default';
2626

27-
const TYPE_SEO = 'seo';
27+
public const TYPE_SEO = 'seo';
2828

2929
protected $primaryKey = 'code';
3030

@@ -39,6 +39,8 @@ class TagType extends Model
3939

4040
protected $translatable = ['name'];
4141

42+
public $guarded = [];
43+
4244
protected static function booted(): void
4345
{
4446
static::created(function (self $status) {

src/Resources/TagResource.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public static function form(Form $form): Form
7272
->hint(flexiblePagesTrans('tags.tag_type_hint'))
7373
->relationship('tagType', 'name')
7474
->preload()
75-
->required()
7675
->default(function (Select $component) {
7776
return $component->getRelationship()?->getModel()->query()
7877
->where('is_default_type', true)->first()->id ?? null;

0 commit comments

Comments
 (0)