Changing Field Wrapper View for Form Component Throws Exception
What I am trying to do:
I am trying to use the
My issue / the error: Appreciate any help! Thanks!
fieldWrapperView()
method on a Select form component to change which blade file gets used for the field wrapper.
What I did:
I copied
vendor/filament/forms/resources/views/components/field-wrapper/index.blade.php
to
resources/views/filament/field-wrapper.blade.php
then updated the Select to:
I also tried various different directory/sub-directory structures and naming conventions in my resources/views
and fieldWrapperView()
calls to make it work, to no avail.
I have another blade template in the same directory, which I use in the ->view('filament.address-verify-city-select')
call and that works just fine.My issue / the error: Appreciate any help! Thanks!
4 Replies
did you clear the cache?
@toeknee Definitely! I've called both
optimize:clear
and filament:optimize-clear
multiple times. Have you gotten fieldWrapperView()
to work correctly?field wrapper is a dynamic component so it has to be in 'resources/views/components' to work the way you are trying to make it work. that's a convention of laravel.
make sure you really need to override the component too. overriding filament's components is not recommended unless you know what you are doing and are will to take on the responsibility of possible breaking changes in the future.
Thank you @awcodes! That did it.
@awcodes Fully understand the warning and the consequences. Thanks for looking out!