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.

v3.0.0(1mo ago)21.1k↓62.4%1MITPHPPHP ^8.4CI passing

Since Mar 29Pushed 1mo 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 today

READMEChangelog (6)Dependencies (17)Versions (8)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 5** 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(Schema $schema): Schema
{
    return $schema->components([
        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(Schema $schema): Schema
{
    return $schema->components([
        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(Schema $schema): Schema
{
    return $schema->components([
        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(Schema $schema): Schema
{
    return $schema->components([
        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

48

—

FairBetter than 93% of packages

Maintenance89

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~81 days

Recently: every ~75 days

Total

6

Last Release

53d ago

Major Versions

v1.0.4 → v2.0.02025-09-01

v2.1.1 → v3.0.02026-05-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10338668?v=4)[Simone Peniti](/maintainers/speniti)[@speniti](https://github.com/speniti)

---

Top Contributors

[![speniti](https://avatars.githubusercontent.com/u/10338668?v=4)](https://github.com/speniti "speniti (18 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

[filament/filament

A collection of full-stack components for accelerated Laravel app development.

3829.6M3.6k](/packages/filament-filament)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1806.0M193](/packages/filament-spatie-laravel-media-library-plugin)[filament/forms

Easily add beautiful forms to any Livewire component.

4831.0M417](/packages/filament-forms)[filament/tables

Easily add beautiful tables to any Livewire component.

3730.5M153](/packages/filament-tables)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1327.7M64](/packages/filament-infolists)[filament/notifications

Easily add beautiful notifications to any Livewire app.

2530.8M86](/packages/filament-notifications)

PHPackages © 2026

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