PHP code example of opscale-co / nova-geospatial-fields
1. Go to this page and download the library: Download opscale-co/nova-geospatial-fields 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/ */
opscale-co / nova-geospatial-fields example snippets
Schema::create('places', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->json('location')->nullable(); // Location field
$table->json('address')->nullable(); // Address field
$table->json('geofence')->nullable(); // Geofence field
$table->json('area')->nullable(); // Area field
$table->json('route')->nullable(); // Route field
$table->timestamps();
});
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Resource;
use Opscale\Fields\Geospatial\Address;
use Opscale\Fields\Geospatial\Area;
use Opscale\Fields\Geospatial\Geofence;
use Opscale\Fields\Geospatial\Location;
use Opscale\Fields\Geospatial\Route;
class Place extends Resource
{
public static $model = \App\Models\Place::class;
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Text::make('Name')->rules('