PHP code example of gian_tiaga / moonshine-coordinates

1. Go to this page and download the library: Download gian_tiaga/moonshine-coordinates library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gian_tiaga / moonshine-coordinates example snippets


$table->json('coordinates')->nullable();

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),