Custom JS in filament page
hello all , is there any way that I can insert javascript in my filament page?
I want to use HTML geolocation and include the latitude and longitude in my form
12 Replies
@leandro_ferreira thank you so much for this
after trying to get the current location, I got in in console. now is there any way that I can put the latitude and longitude in my inputs?
Save yourself some time with #google-maps
thanks friend @wychoong
Tables\Actions\Action::make('test')
->action(function () {
...... (can I link to a JS file here?)
}),
What should a JS file inside a PHP method do?
@Dennis Koch I want to alert some information from the console and show thrm to the user!
eg: html geolocation
You could send a Livewire event and handle that on the frontend. Check the Livewire docs for this.
@push('scripts') seems to be broken in v3.
Worked fine in v2..
Best to use the asset helper:
https://filamentphp.com/docs/3.x/support/assets
Yes, not as convenient, as i'd need to keep running
php artisan filament:assets
but that works. Thanks