PHP code example of traineratwot / filament-openstreetmap
1. Go to this page and download the library: Download traineratwot/filament-openstreetmap 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/ */
traineratwot / filament-openstreetmap example snippets
return new class extends Migration {
public function up(): void
{
Schema::create('points', function (Blueprint $table) {
$table->id();
$table->string('point')->nullable();
$table->json('point_array')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('points');
}
};
namespace App\Models;
use MatanYadaev\EloquentSpatial\Objects\Point;
use Illuminate\Database\Eloquent\Model;
class Point extends Model
{
use SoftDeletes;
protected $guarded = ['id'];
protected function casts()
{
return [
'point' => PointCast::class,
'point_array' => PointCast::class . ':' . PointFormat::ARRAY->value ,
];
}
}