awcodes /
一个用于 Filamentphp 的表单组件,允许在表单中执行操作。
v0.2.2
2023-05-12 12:50 UTC
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-09-08 21:07:38 UTC
README
警告 随着Filament v3的发布,此插件不再必要。将维护v2项目的支持。您可以在Filament文档中了解更多关于"匿名"操作的信息。
一个允许在表单内执行操作的 Filament 表单组件。
安装
您可以通过 composer 安装此包
composer require awcodes/drop-in-action
可选地,您可以使用以下命令发布视图
php artisan vendor:publish --tag="drop-in-action-views"
使用
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')); }); }),
测试
composer test
变更日志
请参阅CHANGELOG,了解更多最近的变化信息。
贡献
请参阅CONTRIBUTING以获取详细信息。
安全漏洞
请参阅我们的安全策略,了解如何报告安全漏洞。
致谢
许可证
MIT 许可证 (MIT)。请参阅许可证文件获取更多信息。