Custom field with api call
I need to build a custom field to make an api call
if i understand well, the api call is made with an action (and i will go into this later)
my problam now is: i have generated the form field with make:form-field
with my two files: resources/views/forms/components/myfield.blade.php and app/forms/components/myfield.php
in my itemResouece.php where i have the other form fields, i simply add Forms\Components\Myfield::make('name')
but i get this error
Class "Forms\Components\Opendata" not found
4 Replies
Can you please read the https://discord.com/channels/883083792112300104/1167015843020943390
So please add some code examples of the files that where created.
yes, sorry
What I am trying to do:
I want to make a custom text field that send the text to an external API and get back some data
at the moment i'm interested in creating the custom field
What I did:
following the proposed tutorial (Build a Custom Form Field on laracast)
i've made
2 files are created
- resources/views/forms/components/myfield.blade.php and app/forms/components/opendata
- app/forms/components/opendata.php
Now, in my Filament/Resources/CompanyResource.php
My issue/the error:
then when i try to show the form
i get this error
Class "Forms\Components\Opendata" not found
Thanks for the code.
The problem is that the namespace
Forms\Components\
is wrong.
It needs to be App\Forms\Components\
The place where the Opendata field is and not the Filament forms components.thanks