V4 Custom data in a RelationManager
I want one of the tabs of my User's relation tables to use custom data. I assume I need to use a relation manager for that, but how do I use custom data in a relation manager?
I tried
but I'm getting error
8 Replies
Going to guess relationmanager tables don't have custom data records support and needs to be a model, since it's classes as a relationship, also you should set keys for the arrays FYI as per the docs.
Yes it seems I misunderstood custom data, it doesn't work on a Resource either without using Models. π€ I need to use a custom page instead to be able to render tables with array data, hopefully I can recreate the nice ui of a regular view resource page
Yeah that makes sense, but you could also create a basic livewire component that renders a table and render that in the form too.
I want the custom data table to live in the tabs alongside regular relationmanagers, so I'll have to see if I can find out how the tabs work

One last try using a "fake" Model. Unfortunately first option throws
Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, array given
, while the second throws Argument #1 ($record) must be of type array, App\Models\Result given
π
You'd probaby be better using sushi for this then
https://github.com/calebporzio/sushi
GitHub
GitHub - calebporzio/sushi: Eloquent's missing "array" driver.
Eloquent's missing "array" driver. Contribute to calebporzio/sushi development by creating an account on GitHub.
Solution
There's not much difference.
Have a look at the ViewPage
page()
method