mark.cameron
summarize and custom model attribute
I'm not sure if they example custom sum above was for Filament
v2.x
or not, but it wasn't working properly on my v3.x
, and was taking all models, not just those limited to the table I was displaying.
Here's a different version based off the above example which I used for formatting the sums of Attributes for a money column, but that can easily be changed according to your needs.
9 replies
How to eager load relationship inside infolist repeatable entry
For future visitors:
You can do something like this to eager load the relationship on the "View" page for your resource by overriding the
mount()
method, might be other ways or cleaner ways, but I couldn't see any other way to interact with the query:
26 replies
How to eager load relationship inside infolist repeatable entry
Ok thanks for the example, but I still get the
but lazy loading is disabled
message for the relationship that I define in the modifyQueryUsing()
. Not sure what I am missing... But even debugging the modifyQueryUsing()
, and I'm not passing through it when on the Infolist...26 replies
How to eager load relationship inside infolist repeatable entry
@Vp Where did you put the
->modifyQueryUsing()
?
I get a method doesn't exist on the Infolist when I try it like this:
It only appears to work on $table
, but that has no effect on ths Infolist display when viewing the model...
Thanks for your help!26 replies
Access resource record/model in custom component registered via registerRenderHook
@Andrius I was running into this issue today too, and I tried putting the
registerRenderHook
in a Middleware instead of a Service provider.
I guess you could probably still do this through a service provider, but it wouldn't be as clean...
Then in the Custom Middleware handle()
method I run my checks for where to add the RenderHook (kind of like using the scopes:
method parameter),
Then in my Livewire component I have a class property which gets populated with the parameter in the @livewire(...)
string from the blade component
4 replies