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

ActiveLibrary

maycolmunoz/moon-leaflet
========================

Leaflet field and component for MoonShine

4.0(5mo ago)2189MITPHPPHP ^8.2|^8.3

Since Aug 26Pushed 5mo agoCompare

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

READMEChangelogDependencies (1)Versions (5)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/f814b8ba454d7370521188d77c91c70e3cd0c5d15212d1878398625123efd2c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6179636f6c6d756e6f7a2f6d6f6f6e2d6c6561666c65742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maycolmunoz/moon-leaflet)[![Total Downloads](https://camo.githubusercontent.com/26622ef5c4c312cff36e98dec543533f58afeb6a22b4f60c013a9cb4e58f6c69/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6179636f6c6d756e6f7a2f6d6f6f6e2d6c6561666c65742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maycolmunoz/moon-leaflet)[![License](https://camo.githubusercontent.com/9352d9bebcccf3cba76f5fb1dca0fd564dc3d2c512d050127b3bec81fddf152e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6179636f6c6d756e6f7a2f6d6f6f6e2d6c6561666c65742e7376673f7374796c653d666c61742d737175617265)](https://github.com/maycolmunoz/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)

MoonShineMoonLeaflet4.0+4.0🧩 Installation
--------------

[](#-installation)

```
composer require maycolmunoz/moon-leaflet
```

---

🚀 Usage
-------

[](#-usage)

### Field

[](#field)

```
use MaycolMunoz\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 MaycolMunoz\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

41

—

FairBetter than 88% of packages

Maintenance77

Regular maintenance activity

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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 ~33 days

Total

4

Last Release

155d ago

Major Versions

1.0 → 2.02025-10-06

2.0 → 3.02025-10-07

3.0 → 4.02025-12-05

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelleafletmapsmoonshinemapleafletmoonshine

### Embed Badge

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

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

###  Alternatives

[ramsey/collection

A PHP library for representing and manipulating collections.

1.2k486.0M69](/packages/ramsey-collection)[dasprid/enum

PHP 7.1 enum implementation

379146.0M11](/packages/dasprid-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49444.8M97](/packages/marc-mabe-php-enum)[phootwork/collection

The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.

3924.8M15](/packages/phootwork-collection)[symfony/ux-leaflet-map

Symfony UX Map Leaflet Bridge

13146.6k1](/packages/symfony-ux-leaflet-map)

PHPackages © 2026

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