F
Filamentβ€’4mo ago
truthzeeker

Can't save relationship on create

I have a pivot table category_comic for this relationship. But can be saved on the edit operation. Here are my files. on resource
Forms\Components\Select::make('categories')
->relationship('categories', 'name')
->searchable()
->preload()
->multiple()
->required(),
Forms\Components\Select::make('categories')
->relationship('categories', 'name')
->searchable()
->preload()
->multiple()
->required(),
on Comic model (guarded)
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Category::class);
}
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Category::class);
}
on Category model (guarded)
public function comic(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Comic::class);
}
public function comic(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Comic::class);
}
No description
Solution:
Nevermind, I overridden the mount method on my Create page. So dumb. πŸ˜„
Jump to solution
1 Reply
Solution
truthzeeker
truthzeekerβ€’4mo ago
Nevermind, I overridden the mount method on my Create page. So dumb. πŸ˜„
Want results from more Discord servers?
Add your server