F
Filament2mo ago
morty

What does `->evaluate()` do?

I see this all over the code base but not really understanding entirely what it's doing. Can someone explain?
Solution:
It handles callbacks that are passed into methods. Ie, if you pass a closure in to something like ->required() the evaluate will run that closure when using $isRequired() in a blade view for example. It also handles dependency injection.
Jump to solution
3 Replies
Solution
awcodes
awcodes2mo ago
It handles callbacks that are passed into methods. Ie, if you pass a closure in to something like ->required() the evaluate will run that closure when using $isRequired() in a blade view for example. It also handles dependency injection.
DrByte
DrByte2mo ago
Dan did a video series on Laracasts where he explains in detail how evaluate() came about and how it works. https://laracasts.com/series/build-advanced-components-for-filament
morty
morty2mo ago
Awesome, I'll check that out. Thanks.
Want results from more Discord servers?
Add your server