Form builder component properties render

Hey there! Can somebody point me where ViewComponent protected properties goes into view render? I only see something like default Laravel behaviour with view('view-name', $this->data()) β€” where ->data() - collects public properties & methods, but how does protected properties goes here? πŸ™‚ Where is this secret method that collects protected properties from component? Would much appreciate your help, guys! @danharrin @zepfietje @awcodes
9 Replies
Dan Harrin
Dan Harrinβ€’2y ago
protected properties arent collected thats why we use public getter methods
awcodes
awcodesβ€’2y ago
Not sure I’m following, but in livewire protected properties are more of an internal functionality which is why they are not fully exposed to the view, they should be only accessible on the server. I’m sure I’m wrong though.
Dan Harrin
Dan Harrinβ€’2y ago
i dont know if hes talking about livewire protected properties
awcodes
awcodesβ€’2y ago
I’m not sure either
danielspravtsev
danielspravtsevOPβ€’2y ago
@awcodes I am talking about Filament View Components that used in Form Builder, not Livewire Component. My question is – Which Filament method collects View component (https://github.com/filamentphp/filament/blob/2.x/packages/forms/src/Components/TextInput.php) protected variables and passes it to it's the blade view? Default Laravel View Components collects only public variables to pass it to blade, so where is Filament method that collects protected properties? πŸ˜€ Sorry if you misunderstood me previously
GitHub
filament/TextInput.php at 2.x Β· filamentphp/filament
Admin panel, form builder and table builder for Laravel. Built with the TALL stack. Designed for humans. - filament/TextInput.php at 2.x Β· filamentphp/filament
Dan Harrin
Dan Harrinβ€’2y ago
it doesnt pass protected properties use getter methods for proper encapsulation
danielspravtsev
danielspravtsevOPβ€’2y ago
Oh, makes sense. Where is this getter methods located?
Dan Harrin
Dan Harrinβ€’2y ago
the form component class check out any of the built in form components, they all use protected properties and getter methods
danielspravtsev
danielspravtsevOPβ€’2y ago
Aww, now I see... It uses the results of component evaluated public methods in blade. Didn't noticed that before. Thanks a lot for clarification!
Want results from more Discord servers?
Add your server