PHPackages                             itsmmunoz/moon-leaflet - 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. itsmmunoz/moon-leaflet

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

itsmmunoz/moon-leaflet
======================

Leaflet field and component for MoonShine

1.0(2w ago)211MITPHPPHP ^8.1

Since May 22Pushed 2w agoCompare

[ Source](https://github.com/itsmmunoz/moon-leaflet)[ Packagist](https://packagist.org/packages/itsmmunoz/moon-leaflet)[ RSS](/packages/itsmmunoz-moon-leaflet/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

🌍 MoonLeaflet — Leaflet for [MoonShine Laravel Admin Panel](https://moonshine-laravel.com)
==========================================================================================

[](#-moonleaflet--leaflet-for-moonshine-laravel-admin-panel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a9b64ec3ffd093e70559a0b8001be80bac45ea712789c55594953cf342b55379/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6974736d6d756e6f7a2f6d6f6f6e2d6c6561666c65742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itsmmunoz/moon-leaflet)[![Total Downloads](https://camo.githubusercontent.com/62ba879cfec0248a073e7bf42013ae5c5f0d4cece07a2d9c72ce745bad514f61/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6974736d6d756e6f7a2f6d6f6f6e2d6c6561666c65742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itsmmunoz/moon-leaflet)[![License](https://camo.githubusercontent.com/f4b91d72f894eba2f0ee7a682115ac1f214b4165f0da825ff3d32fed04ec0100/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6974736d6d756e6f7a2f6d6f6f6e2d6c6561666c65742e7376673f7374796c653d666c61742d737175617265)](https://github.com/itsmmunoz/moon-leaflet/blob/main/LICENSE)

**MoonLeaflet** adds interactive map support to MoonShine. It allows users to select coordinates directly from a map or display multiple locations visually with Leaflet.

- Map field with draggable marker
- Multiple available map layers
- Works in Form, Detail, and Index views
- Component mode with multiple markers
- Optional user geolocation support
- Customizable zoom, drag, and layer

---

🧱 Example Previews
------------------

[](#-example-previews)

FieldComponent[![Field Example](./_docs/images/field.webp)](./_docs/images/field.webp)[![Component Example](./_docs/images/component.webp)](./_docs/images/component.webp)---

### Support MoonShine versions

[](#support-moonshine-versions)

MoonShineMoonLeaflet3.x, 4.x1.0🧩 Installation
--------------

[](#-installation)

```
composer require itsmmunoz/moon-leaflet
```

---

🚀 Usage
-------

[](#-usage)

### Field

[](#field)

```
use ItsmMunoz\MoonLeaflet\Fields\LeafletField;

LeafletField::make('Location') // label
    ->initialPosition(latitude: 40.7580, longitude: -73.9855) //initial position
    ->columns('latitude', 'longitude') // columns in database
    ->draggable(true) // draggable market (optional) default is true
```

### Component

[](#component)

```
use ItsmMunoz\MoonLeaflet\Components\LeafletMap;

LeafletMap::make('Business Locations') // label
    ->initialPosition(latitude: 40.7580, longitude: -73.9855) //initial position
    ->items(fn () => Business::all()
    ->map(function (Business $business) {
        return [
            'name' => $business->name,
            'latitude' => $business->latitude,
            'longitude' => $business->longitude,
        ];
    })->toArray()) // Each item must include name, latitude, and longitude
```

> 💡 The map will attempt to use the user's location if geolocation is enabled.
> If unavailable, it defaults to coordinates `(0, 0)`.

### 🌍 Options for field and component

[](#-options-for-field-and-component)

```
    ->layer('OpenStreetMap') // map layer (default: OpenStreetMap)
    ->minZoom(5) // minimum zoom (default: 5)
    ->maxZoom(18) // maximum zoom (default: 18)
    ->zoom(14) // initial zoom (default: 14)
```

### 🌍 Available Map Layers

[](#-available-map-layers)

Layer Name**OpenStreetMap****OpenTopoMap****CartoDB Dark Matter****CartoDB Positron****CartoDB Voyager****Esri WorldStreetMap****Esri Satellite**

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance96

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

18d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6290a36062f9192c62958c61bcaaf98939afdd53a64ca23ee3810d734967e5ed?d=identicon)[itsmmunoz](/maintainers/itsmmunoz)

---

Top Contributors

[![itsmmunoz](https://avatars.githubusercontent.com/u/94150754?v=4)](https://github.com/itsmmunoz "itsmmunoz (1 commits)")

---

Tags

laravelleafletmapsmoonshinemapleafletmoonshine

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/itsmmunoz-moon-leaflet/health.svg)

```
[![Health](https://phpackages.com/badges/itsmmunoz-moon-leaflet/health.svg)](https://phpackages.com/packages/itsmmunoz-moon-leaflet)
```

###  Alternatives

[symfony/ux-leaflet-map

Symfony UX Map Leaflet Bridge

14171.8k2](/packages/symfony-ux-leaflet-map)

PHPackages © 2026

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