PHPackages                             speniti/filament-mapbox - 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. speniti/filament-mapbox

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

speniti/filament-mapbox
=======================

A set of tools for integrating Mapbox within the Filament ecosystem.

v2.1.1(6mo ago)2785↓50%1MITPHPPHP ^8.4CI passing

Since Mar 29Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/speniti/filament-mapbox)[ Packagist](https://packagist.org/packages/speniti/filament-mapbox)[ RSS](/packages/speniti-filament-mapbox/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

Filament Mapbox
===============

[](#filament-mapbox)

This package provides a set of tools for integrating [Mapbox](https://www.mapbox.com/) within the [Filament](https://filamentphp.com/) ecosystem.

[![GitHub License](https://camo.githubusercontent.com/f23ea1b6cbeb86fdb32baa2db325923d4fdeda2e57e4c6d0ec035f8f718b438e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7370656e6974692f66696c616d656e742d6d6170626f783f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f23ea1b6cbeb86fdb32baa2db325923d4fdeda2e57e4c6d0ec035f8f718b438e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7370656e6974692f66696c616d656e742d6d6170626f783f7374796c653d666c61742d737175617265)[![GitHub Release](https://camo.githubusercontent.com/b487f7785bba30aa65c1d11d623adf40771acdf0d9cbbb35b3204913a0c27255/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7370656e6974692f66696c616d656e742d6d6170626f783f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/b487f7785bba30aa65c1d11d623adf40771acdf0d9cbbb35b3204913a0c27255/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7370656e6974692f66696c616d656e742d6d6170626f783f7374796c653d666c61742d737175617265)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/28744898fcd0299028549ba17522538072eff698f7f76ea6f27f29783d9755d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370656e6974692f66696c616d656e742d6d6170626f782f63692e796d6c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/28744898fcd0299028549ba17522538072eff698f7f76ea6f27f29783d9755d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370656e6974692f66696c616d656e742d6d6170626f782f63692e796d6c3f7374796c653d666c61742d737175617265)[![Codecov](https://camo.githubusercontent.com/7d8168a74e39b187cd3ae6043037cd9a1c2bcba8982bfae178a1bfe7f8a33564/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f7370656e6974692f66696c616d656e742d6d6170626f783f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/7d8168a74e39b187cd3ae6043037cd9a1c2bcba8982bfae178a1bfe7f8a33564/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f7370656e6974692f66696c616d656e742d6d6170626f783f7374796c653d666c61742d737175617265)

Getting started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

This package has been built for **Filament 3** and has been tested only with **PHP 8.4** and **Laravel 12**.

### Installation

[](#installation)

The package can be installed using [Composer](https://getcomposer.org/) with the following command:

```
composer require speniti/filament-mapbox
```

Usage
-----

[](#usage)

### Geocoder Form Component

[](#geocoder-form-component)

A geocoder component using the [Mapbox Geocoding API](https://docs.mapbox.com/api/search/#geocoding). It Can be used in a form to search for an addresses.

[![Geocoder Form Component](art/geocoder/simple.jpg)](art/geocoder/simple.jpg)

#### Basic Usage

[](#basic-usage)

To search for an address, you can use it without any option:

```
public function form(Form $form): Form
{
    return $form->schema([
        Geocoder::make('address'),
    ]);
}
```

#### Options

[](#options)

The component can be customized with the following options:

```
Geocoder::make('address')
    // If true, the geocoder control will clear its contents and blur when the user presses the escape key (default true).
    ->clearAndBlurOnEsc(bool|Closure $clearAndBlurOnEsc = true)
    // Limit the result to the specified countries.
    ->countries(string|array|Closure $countries)
    // Like the one before but only one country.
    ->country(string|Closure $country)
    // Specify the language to use for the results (default 'en').
    ->language(string|Closure $language)
    // Specify whether the Geocoding API should attempt approximate, as well as exact, matching when performing searches (default true).
    ->fuzzyMatch(bool|Closure $fuzzyMatch = true)
    // Limit the maximum number of results to show (default 5).
    ->limit(int|Closure $limit)
    // Set the minimum number of characters to enter before results are shown (default 2).
    ->minLength(int|Closure $minLength)
    // Set a list of types that filter results to match those specified.
    ->types(FeatureType|array|Closure $types)
```

See [FeatureType.php](src/Geocoder/FeatureType.php) for available types.

Aside from the custom options, the component supports placeholder, affixes and suffixes and can be disabled.
The only validation rule supported is `required`.

#### Localization

[](#localization)

The component supports localization. The applied language will depend on the browser's language settings.

#### Output formats

[](#output-formats)

Depending on how you typehint the form property associated with the component, you can get the output in different formats.

For instance if you typehint `string` you will get the address as a string:

```
public string $address = '';

public function form(Form $form): Form
{
    return $form->schema([
        Geocoder::make('address'),
    ]);
}

public function save(): void
{
    $data = $this->form->getState();

    // $address is a string containing the full address.
    // $data['address'] is also a string containing the full address.
    // e.g. "Times Square, New York, New York 10018, Stati Uniti d'America"
}
```

In a similar way, if you typehint `array` you will get an associative array with the address parts:

```
 /** @var array */
public array $address = [];

public function form(Form $form): Form
{
    return $form->schema([
        Geocoder::make('address'),
    ]);
}

public function save(): void
{
    $data = $this->form->getState();

    // $address is an associative array containing the address parts.
    // $data['address'] is also an associative array containing the address parts.
    // e.g. [
    //  address" => "Times Square"
    //    "street" => "Times Square"
    //    "postcode" => "10018"
    //    "place" => "New York"
    //    "region" => "New York"
    //    "country" => "Stati Uniti d'America"
    //    "placeName" => "Times Square, New York, New York 10018, Stati Uniti d'America"
    //    "coords" => array:2 [
    //      0 => -73.98769
    //      1 => 40.75534
    //    ]
    //]
}
```

Lastly, if you prefer a DTO-like approach, you can typehint `AddressInfo` and you will get an instance of the [AddressInfo](src/Geocoder/AddressInfo.php) class:

```
public AddressInfo $address;

public function mount(): void
{
    $this->address = new AddressInfo();
}

public function form(Form $form): Form
{
    return $form->schema([
        Geocoder::make('address'),
    ]);
}

public function save(): void
{
    $data = $this->form->getState();

    // $address is an instance of AddressInfo containing the address parts.
    // $data['address'] is also an instance of AddressInfo containing the address parts.
    // e.g. Peniti\FilamentMapbox\Geocoder\AddressInfo {
    //    placeName: "Times Square, New York, New York 10018, Stati Uniti d'America"
    //    address: "Times Square"
    //    houseNumber: null
    //    street: "Times Square"
    //    postcode: "10018"
    //    place: "New York"
    //    region: "New York"
    //    country: "Stati Uniti d'America"
    //    coords: array:2 [
    //      0 => -73.98769
    //      1 => 40.75534
    //    ]
    //  }
}
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to Filament Mapbox! You can read the contribution guide [here](CONTRIBUTING.md).

Code of Conduct
---------------

[](#code-of-conduct)

To ensure that the community is welcoming to all, please review and abide by the [Code of Conduct](CODE_OF_CONDUCT.md).

License
-------

[](#license)

Filament Mapbox is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance66

Regular maintenance activity

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Total

5

Last Release

199d ago

Major Versions

v1.0.4 → v2.0.02025-09-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fdb84c3d40102107a287ee3c18dbf5ec3b9fad02ddd497053127beffeb6fdb6?d=identicon)[speniti](/maintainers/speniti)

---

Top Contributors

[![speniti](https://avatars.githubusercontent.com/u/10338668?v=4)](https://github.com/speniti "speniti (15 commits)")[![jeffreyvanhees](https://avatars.githubusercontent.com/u/8754630?v=4)](https://github.com/jeffreyvanhees "jeffreyvanhees (1 commits)")

---

Tags

filamentlaravelmapboxphp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/speniti-filament-mapbox/health.svg)

```
[![Health](https://phpackages.com/badges/speniti-filament-mapbox/health.svg)](https://phpackages.com/packages/speniti-filament-mapbox)
```

###  Alternatives

[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[pelmered/filament-money-field

94162.4k1](/packages/pelmered-filament-money-field)[asmit/resized-column

Resizeable column for filament

4857.4k1](/packages/asmit-resized-column)[fatturaelettronicaphp/fattura-elettronica

Pacchetto PHP per la lettura, la generazione e la validazione della fattura elettronica, sia per la Pubblica Amministrazione che tra privati (B2B)

4951.7k](/packages/fatturaelettronicaphp-fattura-elettronica)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[josespinal/filament-record-navigation

Record navigation from views

3142.0k2](/packages/josespinal-filament-record-navigation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
