English 中文(简体)
Filament Many To Many Relation Manager , not working
原标题:

I have the model Student

Student

  • groups : BelongsToMany

and model Group

Group

  • students: HasMany

of course there is a pivot table group_student with

group_id student_id

I am trying, in Filament3, to set up a StudentRelationManager , so that I can add students to a group , with the table (not with select )

I ran this command

php artisan make:filament-relation-manager GroupResource students student_id

and of course added the relation

public static function getRelations(): array
    {
        return [
            RelationManagersStudentsRelationManager::class
        ];
    }

but the minute a click on edit on a given Group record

I get this enter image description here

which is wrong because the student doesnt belong to just one group, but could be in many, so it doesnt have a group_id, but depends on the pivot table : group_student

Instead of something like this

enter image description here

What I am missing ? how to make it work ? can this be achieved ? I searched but could nt find other than fixing it with selects .

Please advice

问题回答

暂无回答




相关问题
Bash edit file and keep last 500 lines

I am looking to create a cron job that opens a directory loops through all the logs i have created and deletes all lines but keep the last 500 for example. I was thinking of something along the lines ...

tailf for windows [closed]

I found tail2win but it is a paid product. Are there any good freeware or shareware out there?

"tailing" a binary file based on string location using bash?

I ve got a bunch of binary files, each containing an embedded string near the end of the file but at different places (only occurs once in each file). I need to extract the part of the file starting ...

How do you continuously read a file in Java?

I m trying to figure out how to continuously read a file and once there is a new line added, output the line. I m doing this using a sleep thread however it just seems to blow through the whole file ...

Ending tail -f started in a shell script

I have the following. A Java process writing logs to the stdout A shell script starting the Java process Another shell script which executes the previous one and redirects the log I check the log ...

Haskell tail function for empty lists

I have a problem with a function that should only return the tail of a list. The functions is myTail and should give a useable result, even if the input is an empty list. I want to understand all 3 ...

热门标签