Using global variable in form input method at resource class
How can I use like a global variable in form input method at resource class?
Here's my case:
I want $record->retur_vendor_detail->sum('jumlah') to be called only once.
Solution:Jump to solution
Yes.
$this->record->loadSum('retur_vendor_detail')
and then use $this->record->retur_vendor_detail_sum
5 Replies
can someone help me?
$record
is not a global variable. It's injected by Filament. Is this really only form builder or in a Panel? Ideally you eager-load that data on mountyeah that's only in form builder..
so i need to load both in create and edit record page mount?
Solution
Yes.
$this->record->loadSum('retur_vendor_detail')
and then use $this->record->retur_vendor_detail_sum
thanks for your help.. π