How to pass custom data to view from Custom Field?
I have a custom field called Checklist.
In a loop, I am passing the $record to a custom method called device, and a checklist_id from a pivot table 'checklist_device' to a method called list.
This is to render specific json items from this pivot table in a field called 'items'.
This is my custom field class:
I guess what I'm failing to understand is how to bypass that 'make' function and in my view, have custom data from the render method instead, as you can see
$checklistItems
is currently not doing anything.2 Replies
FYI, this is the basis of my view
And this works perfectly when rendering for example a json field on my Device model.
I need this to also grab data from a specific pivot model.
Bump
I'm sorry, what is the question exactly? It looks like you have already figured out how to pass variables to your view?