Infolist, returning acccessor data from the model
Good Afternoon,
I've searched the documentation on this, and I must be missing it...but how do you call a model method to display in an infolist.
For example, I have a
client
model with a method getFullAddress()
.
How do I call that within the public static function infolist(Infolist $infoList) : Infolist
to return that accessor within a make
line ?
Thanks for takign the time to read.Solution:Jump to solution
Got it I think:
->schema([
TextEntry::make('Address')
->state(fn ($record) => $record->getFullAddress()),...
1 Reply
Solution
Got it I think:
->schema([
TextEntry::make('Address')
->state(fn ($record) => $record->getFullAddress()),
]);
Unless anyone has a simplified version...