awcodes / drop-in-action
A form component for Filamentphp allowing actions inside of forms.
Fund package maintenance!
awcodes
Installs: 46 757
Dependents: 0
Suggesters: 0
Security: 0
Stars: 85
Watchers: 2
Forks: 3
Open Issues: 2
Requires
- php: ^8.0
- filament/filament: ^2.0
- illuminate/contracts: ^9.0|^10.0
- spatie/laravel-package-tools: ^1.13.5
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0|^7.0
- orchestra/testbench: ^7.0|^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-livewire: ^1.0
- pestphp/pest-plugin-parallel: ^0.3
- phpunit/phpunit: ^9.5|^10.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-12-08 21:41:57 UTC
README
Warning With the release of Filament v3 this plugin is no longer necessary. Support will be maintained for v2 projects. You can read more about "anonymous" actions on the Filament Docs.
A form component for Filament allowing actions inside of forms.
Installation
You can install the package via composer:
composer require awcodes/drop-in-action
Optionally, you can publish the views using
php artisan vendor:publish --tag="drop-in-action-views"
Usage
use Awcodes\DropInAction\Forms\Components\DropInAction; DropInAction::make('test') ->disableLabel() ->execute(function (Closure $get, Closure $set) { return Action::make('geolocate') ->icon('heroicon-o-search') ->label('Geocode') ->action(function () use ($get, $set) { try { $mapsData = Http::get(config('services.google_maps.url') . '?key=' . config('services.google_maps.key') . '&address=' . $address . '&sensor=true') ->throw() ->json(); } catch (RequestException $e) { Filament::notify('danger', 'Unable to geocode for this address.'); return; } $set('latitude', $mapsData['results'][0]['geometry']['location']['lat'] ?? $get('latitude')); $set('longitude', $mapsData['results'][0]['geometry']['location']['lng'] ?? $get('longitude')); }); }),
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.