PHPackages                             arielmejiadev/leaflet-for-laravel - 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. [Templating &amp; Views](/categories/templating)
4. /
5. arielmejiadev/leaflet-for-laravel

ActiveLibrary[Templating &amp; Views](/categories/templating)

arielmejiadev/leaflet-for-laravel
=================================

brings an easy integration to use leaflet javascript library using Laravel with blade views

1.1.1(1w ago)015↑500%[5 PRs](https://github.com/ArielMejiaDev/leaflet-for-laravel/pulls)MITPHPPHP ^8.3CI passing

Since May 22Pushed 1w agoCompare

[ Source](https://github.com/ArielMejiaDev/leaflet-for-laravel)[ Packagist](https://packagist.org/packages/arielmejiadev/leaflet-for-laravel)[ Docs](https://github.com/arielmejiadev/leaflet-for-laravel)[ GitHub Sponsors](https://github.com/arielmejiadev)[ RSS](/packages/arielmejiadev-leaflet-for-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (13)Versions (9)Used By (0)

Leaflet for Laravel
===================

[](#leaflet-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e6c35fceaa995cb66b7161e27cccab2ee53994f4e6c97fbce6d554e884190226/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617269656c6d656a69616465762f6c6561666c65742d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arielmejiadev/leaflet-for-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/69238b765b62f20d04a7dc237c0ee81578e6512e9a3325ff6140906cf83f1165/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f617269656c6d656a69616465762f6c6561666c65742d666f722d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/arielmejiadev/leaflet-for-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8d6a0ffc7f6f53203d38fa7eafa79e58a2b572303a6c8a0b8de5bcc814d98397/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f617269656c6d656a69616465762f6c6561666c65742d666f722d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/arielmejiadev/leaflet-for-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7b9cd43160ca7221770692e011c4846f742691228767a9106b19ba763e02f757/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617269656c6d656a69616465762f6c6561666c65742d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arielmejiadev/leaflet-for-laravel)

A fluent, expressive PHP API for rendering [Leaflet.js](https://leafletjs.com) maps in Laravel — no JavaScript required.

**[Full Documentation](https://arielmejia.dev/leaflet-for-laravel/)**

Quick Start
-----------

[](#quick-start)

### 1. Install

[](#1-install)

```
composer require arielmejiadev/leaflet-for-laravel
```

### 2. Build a map in your controller

[](#2-build-a-map-in-your-controller)

```
use arielmejiadev\LeafletForLaravel\LeafletMap;
use arielmejiadev\LeafletForLaravel\Marker;

class LandmarkController extends Controller
{
    public function index()
    {
        $map = LeafletMap::of('landmarks')
            ->center(40.6892, -74.0445)
            ->zoom(15)
            ->marker(40.6892, -74.0445, fn (Marker $pin) => $pin
                ->popup('Statue of LibertyNew York, NY')
                ->icon('blue')
            );

        return view('landmarks.index', compact('map'));
    }
}
```

### 3. Render in Blade

[](#3-render-in-blade)

```

    @leafletStyles

    @leafletMap($map)

```

That's it — two Blade directives and you have a live, interactive map.

Features
--------

[](#features)

- **Pure PHP** — write maps in PHP, zero JavaScript needed
- **Fluent API** — chainable methods like `->center()->zoom()->marker()`
- **Markers** — popups, tooltips, draggable pins, colored icons, circles
- **Glyph Icons** — Font Awesome &amp; Material Design icons rendered on pins
- **Layer Control** — multiple base map styles + toggleable overlay groups
- **GeoJSON** — render points, lines, and feature collections
- **Blade Directives** — `@leafletStyles` + `@leafletMap($map)`
- **Livewire Ready** — scaffold components with `php artisan make:leaflet`
- **Macros &amp; Conditionals** — extend with `Map::macro()`, branch with `->when()`
- **Multiple Maps** — independent instances on the same page

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

[](#installation)

```
composer require arielmejiadev/leaflet-for-laravel
```

Optionally publish the config:

```
php artisan vendor:publish --tag="leaflet-for-laravel-config"
```

Documentation
-------------

[](#documentation)

Visit the **[full documentation site](https://arielmejia.dev/leaflet-for-laravel/)** for guides on:

- [Maps](https://arielmejia.dev/leaflet-for-laravel/maps) — center, zoom, dimensions, tile layers, macros
- [Markers](https://arielmejia.dev/leaflet-for-laravel/markers) — popups, tooltips, icons, circles, bulk markers
- [Icons](https://arielmejia.dev/leaflet-for-laravel/icons) — colors, custom icons, Font Awesome &amp; Material Design glyphs
- [Layer Control](https://arielmejia.dev/leaflet-for-laravel/layer-control) — base map switching, overlay groups
- [GeoJSON](https://arielmejia.dev/leaflet-for-laravel/geojson) — points, lines, files, APIs
- [Advanced Example](https://arielmejia.dev/leaflet-for-laravel/advanced-example) — full controller with everything combined
- [Artisan Command](https://arielmejia.dev/leaflet-for-laravel/artisan-command) — generate PHP or Livewire map classes

Testing
-------

[](#testing)

```
composer test
```

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)

- [ArielMejiaDev](https://github.com/arielmejiadev)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance98

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

3

Last Release

12d ago

### Community

Maintainers

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

---

Top Contributors

[![ArielMejiaDev](https://avatars.githubusercontent.com/u/31971074?v=4)](https://github.com/ArielMejiaDev "ArielMejiaDev (3 commits)")

---

Tags

laravelarielmejiadevleaflet-for-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/arielmejiadev-leaflet-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/arielmejiadev-leaflet-for-laravel/health.svg)](https://phpackages.com/packages/arielmejiadev-leaflet-for-laravel)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M41](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k9.9M87](/packages/dedoc-scramble)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[spatie/laravel-passkeys

Use passkeys in your Laravel app

463755.5k32](/packages/spatie-laravel-passkeys)[spatie/laravel-blade-comments

Add debug comments to your rendered output

179332.0k](/packages/spatie-laravel-blade-comments)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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