Replies: 4 comments 1 reply
|
There's a distinct possibility I've gotten caught up in nonsense. Is there a reason this should be handled in the Brick rather than as a super-simple prop in the view? I don't need to pass in the current Eloquent record until the view really, the only thing that's contextual for each user is already being handled by view policies. |
|
I'm back to square one with this unfortunately. When adding a Brick with the above blade change, I have the same $this issue.
May be stumped here. toHtml needs to do the same thing regardless of the operation (preview or output into the frontend), do you have any ideas? |
|
Oh perfect, this is fantastic news. Funnily enough, I did try making a small incision into $data but I backed off after not being 100% confident I'd be overwriting something important (short of setting the key as something unreasonably unique I suppose). So glad I could help improve the mechanism in my own way.
|



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi all!
I'm looking to implement a context to the Brick (or the Brick Collection, I don't mind) where I inject the current Eloquent record I've added the Brick to. It's a custom record edit page though: https://filamentphp.com/docs/5.x/resources/custom-pages.
The schema within the EditRecord:
The custom Brick:
Normally, I know I can create a custom field and pull in the record (https://filamentphp.com/docs/5.x/resources/custom-pages#using-a-resource-record) but I can't just pass in $this to the view. Using viewData hasn't worked either:
Any ideas? Thanks all!
All reactions