PHP code example of afsakar / filament-leaflet-map-picker
1. Go to this page and download the library: Download afsakar/filament-leaflet-map-picker 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/ */
afsakar / filament-leaflet-map-picker example snippets
Schema::create('properties', function (Blueprint $table) {
$table->id();
// Other columns
$table->text('location')->nullable(); // Stores coordinates as JSON string
// OR
$table->json('location')->nullable(); // Alternative approach
$table->timestamps();
});
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Property extends Model
{
protected $fillable = [
// Other fillable fields
'location',
];
protected $casts = [
'location' => 'array',
];
}