gian_tiaga / moonshine-coordinates
Field of coordinates on leaflet map for moonshine admin panel
Installs: 483
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
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-11-14 12:39:26 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),