gian_tiaga/moonshine-coordinates
月亮管理面板的地图坐标字段
1.0.2
2024-06-12 12:31 UTC
Requires
- php: ^8.2
Requires (Dev)
- larastan/larastan: ^2.0
- laravel/framework: ^11.10
- moonshine/moonshine: ^2.14
- orchestra/testbench: ^9.1
Conflicts
- moonshine/moonshine: <2.0
This package is not auto-updated.
Last update: 2024-09-19 12:04:34 UTC
README
安装
composer require gian_tiaga/moonshine-coordinates
使用
- 在迁移中添加坐标字段
$table->json('coordinates')->nullable();
- 在模型中添加
cast
use GianTiaga\MoonshineCoordinates\Casts\CoordinatesCast; // ...code /** * @return array<string, string> */ protected function casts(): array { return [ 'coordinates' => CoordinatesCast::class, ]; }
- 在资源中使用字段
use GianTiaga\MoonshineCoordinates\Dto\CoordinatesDto; use GianTiaga\MoonshineCoordinates\Fields\Coordinates; // ...code Coordinates::make('Расположение', 'coordinates') ->center(new CoordinatesDto( latitude: 55.7505412, longitude: 37.6174782 )) ->zoom(10),