F
Filament4mo ago
kisut

Relation Manager section didn't show up

Hi, I created a belongsToMany relation between two models with this setting. Track Model
public function releases()
{
return $this->belongsToMany(Release::class);
}
public function releases()
{
return $this->belongsToMany(Release::class);
}
Release Model
public function trackAlbum()
{
return $this->belongsToMany(Track::class, 'album_track', 'release_id', 'track_id');
}
public function trackAlbum()
{
return $this->belongsToMany(Track::class, 'album_track', 'release_id', 'track_id');
}
and I created a relation manager with commands like this
php artisan make:filament-relation-manager ReleaseResource trackAlbum track_title
php artisan make:filament-relation-manager ReleaseResource trackAlbum track_title
I have registered the relation in Release resource but the section relation under the form is not showing up. Is there a mistake?
6 Replies
Andi
Andi4mo ago
The relation manager shows only on view and edit, not on create, also share ur resource relations
kisut
kisutOP4mo ago
Ah i see, I'm looking at create right now. Any ways to display it on create? Or maybe another method?
awcodes
awcodes4mo ago
It can’t exist on create because there’s no relationship yet to manage. You could have selects though to attach / sync certain kinds of relationships on create though.
Andi
Andi4mo ago
As awcodes wrote no, there is no possibility. You can also use a repeater, which is only visible on create
kisut
kisutOP4mo ago
I'm interested in using repeaters, but is it possible if each repeater saves its own data to a separate table? In my case I created a repeater in Release and the repeater will save data to Track
awcodes
awcodes4mo ago
Sorry, but it really sounds like you are trying everything you can to not use a relationship when in fact it is a relationship. If the relationships are all set up correctly filament will just do it. I am, of course assuming you are using panels vs stand-alone packages.
Want results from more Discord servers?
Add your server