Getting Filament Drawable Map running in your project takes only a few minutes. You will install the package via Composer, publish the configuration file, and supply your Google Maps API key through an environment variable. An optional step lets you publish the Blade views for deeper customization of the map field templates.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diegobas/filament-drawable-map/llms.txt
Use this file to discover all available pages before exploring further.
Publish the config file
Publish the package configuration file so you can customize the default map location and API key settings:This creates
config/filament-drawable-map.php in your application.Set your Google Maps API key
Add your Google Maps API key to your
.env file. The Maps JavaScript API must be enabled for the key in the Google Cloud Console:The
FilamentDrawableMapServiceProvider is registered automatically via Laravel’s package auto-discovery. You do not need to add it to config/app.php or call ->plugin() on your Filament panel.This package does not register publishable migrations. Add the polygon column directly to your own model’s migration — typically a nullable JSON column such as
$table->json('zone')->nullable(). See the Quickstart for a complete example.Configuration File
After publishing,config/filament-drawable-map.php will contain the following defaults. Set GOOGLE_MAPS_API_KEY in your environment rather than hardcoding it here, and adjust the default location coordinates to a sensible center point for your application’s geography:
location values are used as the initial map center when no per-field location() override is provided.
Dependencies
| Dependency | Required Version |
|---|---|
php | ^8.0 |
filament/filament | ^3.0 |
spatie/laravel-package-tools | ^1.16 |
illuminate/contracts | ^9.0 | ^10.0 | ^11.0 |