PHPackages                             heloufir/filament-leaflet-geosearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heloufir/filament-leaflet-geosearch

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

heloufir/filament-leaflet-geosearch
===================================

Implementation of LeafLet GeoSearch as a Filament Form Field

1.1.1(3y ago)232.0k↓100%9[3 issues](https://github.com/heloufir/filament-leaflet-geosearch/issues)MITBladePHP ^8.0

Since Jul 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/heloufir/filament-leaflet-geosearch)[ Packagist](https://packagist.org/packages/heloufir/filament-leaflet-geosearch)[ Docs](https://github.com/heloufir/filament-leaflet-geosearch)[ GitHub Sponsors](https://github.com/heloufir)[ RSS](/packages/heloufir-filament-leaflet-geosearch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (11)Used By (0)

Filament LeafLet GeoSearch
==========================

[](#filament-leaflet-geosearch)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a709e6db68777aef2c2d2161458bd6517dfc7e0817ae86287c3998c6db946b34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656c6f756669722f66696c616d656e742d6c6561666c65742d67656f7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/heloufir/filament-leaflet-geosearch)[![Total Downloads](https://camo.githubusercontent.com/88d977302a35bbb535eefba1c5ff4a43886c818cf5517a3a87fb733bc67a4cb6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68656c6f756669722f66696c616d656e742d6c6561666c65742d67656f7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/heloufir/filament-leaflet-geosearch)

This package provides a Filament Form Field integration of the LeafLet GeoSearch package

[![Filament LeafLet GeoSearch](filament-leaflet-geosearch-demo.png)](filament-leaflet-geosearch-demo.png)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require heloufir/filament-leaflet-geosearch
```

You need to publish assets used by this package:

```
php artisan vendor:publish --tag=filament-leaflet-geosearch-assets
```

> **From the version 1.1.0, you need to register manually the assets (styles and scripts)**
>
> This decision was made to make the plugin standalone for users who want to use it without Filament administration (only with Filament forms)

- If you are using this package with `Filament administration`, add this lines to the `boot()` function of your `AppServiceProvider`

```
public function boot()
{
    // ...
    Filament::serving(function () {
        // ...
        Filament::registerStyles([
            asset('filament/assets/css/leaflet.css'),
            asset('filament/assets/css/geosearch.css'),
        ]);
        Filament::registerScripts([
            asset('filament/assets/js/leaflet.js'),
            asset('filament/assets/js/geosearch.umd.js'),
        ], true);
        // ...
    });
    // ...
}
```

**Important: Don't forget the `true` flag on the `registerScripts` to make the scripts loaded before Filament core scripts**

- If you are using this package without `Filament administration` (only with `Filament forms`), you can include the styles and scripts into your html layout.

Usage
-----

[](#usage)

### Model configuration

[](#model-configuration)

In your model you need to add the location column cast:

```
