PHPackages                             kpebedko22/filament-yandex-map - 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. kpebedko22/filament-yandex-map

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

kpebedko22/filament-yandex-map
==============================

This is my package filament-yandex-map

v5.0.0(1w ago)52.4k↓48.9%1[1 issues](https://github.com/kpebedko22/filament-yandex-map/issues)MITPHPPHP ^8.3

Since Dec 27Pushed 1w ago1 watchersCompare

[ Source](https://github.com/kpebedko22/filament-yandex-map)[ Packagist](https://packagist.org/packages/kpebedko22/filament-yandex-map)[ Docs](https://github.com/kpebedko22/filament-yandex-map)[ RSS](/packages/kpebedko22-filament-yandex-map/feed)WikiDiscussions v5 Synced yesterday

READMEChangelog (6)Dependencies (24)Versions (13)Used By (0)

Filament Yandex Map
===================

[](#filament-yandex-map)

This package provides a set of tools for using Yandex Map within the [Laravel Filament](https://github.com/filamentphp/filament).

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

[](#installation)

You can install the package via composer:

```
composer require kpebedko22/filament-yandex-map
```

Modify `services.php` config file. This is the contents of the config file:

```
return [
    // ...

    'yandex_map' => [
        'api_key' => env('YANDEX_MAP_API_KEY', ''),
        'suggest_api_key' => env('YANDEX_MAP_SUGGEST_API_KEY', ''),
        'lang' => 'ru_RU',
        'center' => [53.35, 83.75],
        'zoom' => 12,
    ],
];
```

Optionally, you can publish the translations using:

```
php artisan vendor:publish --tag="filament-yandex-map-translations"
```

Usage
-----

[](#usage)

### Form component

[](#form-component)

```
->schema([
    YandexMap::make('point')
        // Set mode of geo-object. Always required!
        ->usingPlacemark()
        // or set mode of geo-object with geo-object properties and options
        ->usingPlacemark(
            new PlacemarkProperties(),
            new PlacemarkOptions(),
        )
        // or set mode of geo-object using mode() method
        ->mode(YandexMapMode::Placemark)
        // By default, values are taken from config
        // You are free to override them using plain values or closure
        ->apiKey('your_yandex_api_key')
        ->suggestApiKey('your_yandex_suggest_api_key')
        ->center([53.35, 83.75])
        ->zoom(12)
        ->lang('ru_RU')
        // By default: 600px
        ->height('600px')
        // Setup control buttons
        ->deleteBtnParameters(
            new ButtonData(__('filament-yandex-map::control-buttons.delete')),
            new ButtonOptions(
                float: ButtonFloat::Right,
                selectOnClick: false
            ),
        )
        ->drawBtnParameters()
        ->editBtnParameters()
        // It's required to set up `formatStateUsing`, `dehydrateStateUsing` methods
        // to properly take data from record. The package provides some implementations
        // for common cases. Find more information further below.
        ->usingArray('lat', 'lng')
        ->usingMagellan()
])
```

### Infolist component

[](#infolist-component)

```
->schema([
    YandexMapEntry::make('point')
        // Set mode of geo-object. Always required!
        ->usingPlacemark()
        // By default, values are taken from config
        // You are free to override them using plain values or closure
        ->apiKey('your_yandex_api_key')
        ->suggestApiKey('your_yandex_suggest_api_key')
        ->center([53.35, 83.75])
        ->zoom(12)
        ->lang('ru_RU')
        // By default: 600px
        ->height('600px')
        // It's required to set up `getStateUsing` method
        // to properly take data from record. The package provides some implementations
        // for common cases. Find more information further below.
        ->usingArray('lat', 'lng')
        ->usingMagellan()
])
```

Geometries
----------

[](#geometries)

The package provides work with the following types of geometries (geo-objects):

- **Point**
- **Linestring**
- **Polygon**

Storing geometries in database
------------------------------

[](#storing-geometries-in-database)

Since there are different ways to store geo-object data in database table, the package cannot cover all options. But it provides two out-of-the-box usage options:

- json column
- postgis column

### Json column

[](#json-column)

The package uses array of two coordinates `[lat, lng]` for storing point coordinates. E.g.: `[53.35, 83.75]`, where `53.35` is latitude and `83.75` is longitude.

If you're store coordinates of point as json-object, e.g.: `{"lat": 53.35, "lng": 83.75}`, then you should use `->usingArray('lat', 'lng')` method.

### Postgis column (PostgreSQL)

[](#postgis-column-postgresql)

For ease of working with postgis columns it's recommended to use [Laravel Magellan](https://github.com/clickbar/laravel-magellan) package.

The package supports work with the following geometries:

ClassMigration`Clickbar\Magellan\Data\Geometries\Point``$table->magellanPoint('point')``Clickbar\Magellan\Data\Geometries\LineString``$table->magellanLineString('line')``Clickbar\Magellan\Data\Geometries\Polygon``$table->magellanPolygon('polygon')`### Separate lat/lng columns

[](#separate-latlng-columns)

If you are storing latitude and longitude of the point in the different columns of your database table, then you need to write your own implementation of `formatStateUsing` and mutate data before saving.

```
// On the form
use Kpebedko22\FilamentYandexMap\Forms\Components\YandexMap;
use Kpebedko22\FilamentYandexMap\ValueObjects\Point;
use Kpebedko22\FilamentYandexMap\Enums\YandexMapMode;

YandexMap::make('point')
    ->usingPlacemark()
    ->formatStateUsing(static function (?Model $record) {
        return $record
            ? (new Point($record->lat, $record->lng))->toArray()
            : null;
    }),

// CreatePage
protected function mutateFormDataBeforeCreate(array $data): array
{
    $data['lat'] = $data['point']['lat'];
    $data['lng'] = $data['point']['lng'];
    unset($data['point']);

    return parent::mutateFormDataBeforeCreate($data);
}

// EditPage
protected function mutateFormDataBeforeSave(array $data): array
{
    $data['lat'] = $data['point']['lat'];
    $data['lng'] = $data['point']['lng'];
    unset($data['point']);

    return parent::mutateFormDataBeforeSave($data);
}
```

Localization
------------

[](#localization)

The list of available locales can be found in `YandexMapLang` enum.

Geometries control buttons
--------------------------

[](#geometries-control-buttons)

List of available control buttons:

- toggle editing mode
- toggle drawing mode
- delete geo-object

Since the form may require using several map components, there is a nuance with the automatic inclusion of `editor.startDrawing()`, `editor.startEditing()`. The last loaded map component will dominate. Therefore, in order to edit/draw on the map, control buttons are added that include these functions. There is also a button to delete a geo-object.

Default state of control buttons:

```
YandexMap::make('point')
    ->usingPlacemark()
    ->deleteBtnParameters(
        new ButtonData(__('filament-yandex-map::control-buttons.delete')),
        new ButtonOptions(
            float: ButtonFloat::Right,
            selectOnClick: false
        ),
    );
    ->drawBtnParameters(
        new ButtonData(__('filament-yandex-map::control-buttons.draw')),
        new ButtonOptions(float: ButtonFloat::Right),
    );
    ->editBtnParameters(
        new ButtonData(__('filament-yandex-map::control-buttons.edit')),
        new ButtonOptions(float: ButtonFloat::Right),
    );
```

You are free to change the visual state of this control buttons.

Geometries properties and options
---------------------------------

[](#geometries-properties-and-options)

You can modify geo-object properties and options.

Testing
-------

[](#testing)

No tests yet.

```
composer test
```

Sandbox
-------

[](#sandbox)

Detailed information about sandbox you can find in [Sandbox README](./sandbox/README.md) file.

### How to set up and run

[](#how-to-set-up-and-run)

Setup `./sandbox/.env` file.

Create a symlink to the `.env` file in the project root:

```
ln -sf ./sandbox/.env ./.env
```

Build and start Docker containers:

```
make build
make up
```

Run Artisan commands inside the `fpm` container.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Alexander Voytsekhovsky](https://github.com/kpebedko22)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance94

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 73.3% 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 ~68 days

Total

9

Last Release

9d ago

Major Versions

v3.x-dev → v4.0.02025-09-08

v4.x-dev → v5.0.02026-06-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36397871?v=4)[Alexander](/maintainers/kpebedko22)[@kpebedko22](https://github.com/kpebedko22)

---

Top Contributors

[![kpebedko22](https://avatars.githubusercontent.com/u/36397871?v=4)](https://github.com/kpebedko22 "kpebedko22 (11 commits)")[![altrntv](https://avatars.githubusercontent.com/u/28820687?v=4)](https://github.com/altrntv "altrntv (4 commits)")

---

Tags

filamentphplaravelyandex-maplaravelfilamentfilament-yandex-mapfilament form componentyandex-map

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kpebedko22-filament-yandex-map/health.svg)

```
[![Health](https://phpackages.com/badges/kpebedko22-filament-yandex-map/health.svg)](https://phpackages.com/packages/kpebedko22-filament-yandex-map)
```

###  Alternatives

[ysfkaya/filament-phone-input

A phone input component for Laravel Filament

3161.3M25](/packages/ysfkaya-filament-phone-input)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

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