Editable Columns Plugin -> Using Editable Select with relationships #358
-
|
Related to the next post; https://stackoverflow.com/questions/74825271/editable-columns-plugin-using-editable-select-gives-error , I get the same error. ... So I wonder if it really works in case of a relationship with another model. Has anyone already succeeded? If so, any idea what I could be doing wrong? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hello @ceeckhout Editable columns doesn't understand relationships like backpack fields do. You should provide the CRUD::column('supplier1_id') // use the database column name
->type('editable_select')
->options(\App\Models\Supplier::all()->pluck('name', 'id')->toArray());Cheers |
Beta Was this translation helpful? Give feedback.
Hello @ceeckhout
Editable columns doesn't understand relationships like backpack fields do.
You should provide the
database column nameof the relationship, in your case, probablysupplier1_idso it should be:Cheers