PHPackages                             bagusindrayana/laravel-maps - 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. bagusindrayana/laravel-maps

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

bagusindrayana/laravel-maps
===========================

set mapbox and leaflet map initiation from within laravel

v0.2.2(4y ago)145342[1 issues](https://github.com/bagusindrayana/laravel-maps/issues)MITPHP

Since Jan 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bagusindrayana/laravel-maps)[ Packagist](https://packagist.org/packages/bagusindrayana/laravel-maps)[ RSS](/packages/bagusindrayana-laravel-maps/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Demo :

### Installation

[](#installation)

```
composer require bagusindrayana/laravel-maps
```

Add LaravelMapServiceProvider::class to config/app.php

```
    'providers'=>[
        //....

        Bagusindrayana\LaravelMaps\LaravelMapsServiceProvider::class,

        //...
    ],

```

publish provider

```
php artisan vendor:publish --provider=Bagusindrayana\LaravelMaps\LaravelMapsServiceProvider
```

### Usage

[](#usage)

in controller

```
$map = LaravelMaps::leaflet('map')
->setView([51.505, -0.09], 13);

return view('your-view',compact('map'));
```

in view

```

    My Map
    {!! @$map->styles() !!}

    {!! @$map->render() !!}
    {!! @$map->scripts() !!}

```

Leaflet
-------

[](#leaflet)

### Features

[](#features)

- marker
- circle
- polygon
- geojson
- basic event and method

### Basic Usage

[](#basic-usage)

```
//'map' is variable name will be use in javascript code
$map = LaravelMaps::leaflet('map')
->setView([51.505, -0.09], 13)
->addMarker(function(LeafletMarker $marker){
    return $marker
    ->latLng([51.5, -0.09])
    ->bindPopup('Hello world!I am a popup.');
})
->addCircle(function(LeafletCircle $circle){
    return $circle
    ->latLng([51.508, -0.11])
    ->options([
        'radius'=>500,
        'color'=>'red',
        'fillColor'=>'#f03',
        'fillOpacity'=>0.5
    ])
    ->bindPopup("I am a circle.");
})
->addPolygon(function(LeafletPolygon $polygon){
    return $polygon
    ->latLng([
        [51.509, -0.08],
        [51.503, -0.06],
        [51.51, -0.047]
    ])
    ->bindPopup("I am a polygon.");
})
->addPopup("I am a standalone popup.",[51.513, -0.09]);
```

### Method &amp; Event

[](#method--event)

method are dynamic so you can use most method from original leaflet argument or parameter in method can be array,Closure,string,and RawJs class

Mapbox
------

[](#mapbox)

### Features

[](#features-1)

- marker
- geojson
- basic event and method

### Basic Usage

[](#basic-usage-1)

```
//'map' is variable name will be use in javascript code
$map = LaravelMaps::mapbox('map',[
    "center"=>[106.827293,-6.174465],
    "zoom"=>13,
]);

$map->on('load',function($m){
    $m->addMarker(function(MapboxMarker $marker){
        return $marker
        ->lngLat([51.5, -0.09])
        ->setPopup('Hello world!I am a popup.');
    });
});
```

### Method &amp; Event

[](#method--event-1)

method are dynamic so you can use most method from original mapbox argument or parameter in method can be array,Closure,string,and RawJs class

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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

Total

4

Last Release

1592d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2289cf54dc78208267d2e3a0d54c4b268f7db0af9befab35cdb1d46a12b4ca0e?d=identicon)[bagusindrayana](/maintainers/bagusindrayana)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/bagusindrayana-laravel-maps/health.svg)

```
[![Health](https://phpackages.com/badges/bagusindrayana-laravel-maps/health.svg)](https://phpackages.com/packages/bagusindrayana-laravel-maps)
```

###  Alternatives

[php-ffmpeg/extras

A set of audio/video formats compatible with PHP-FFMpeg

182287.6k1](/packages/php-ffmpeg-extras)

PHPackages © 2026

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