PHPackages                             teamzac/laravel-tileserver - 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. teamzac/laravel-tileserver

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

teamzac/laravel-tileserver
==========================

Turn your Laravel app into an XYZ tile server using your own mbtiles resources.

6567PHP

Since May 29Pushed 2y ago2 watchersCompare

[ Source](https://github.com/teamzac/laravel-tileserver)[ Packagist](https://packagist.org/packages/teamzac/laravel-tileserver)[ RSS](/packages/teamzac-laravel-tileserver/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Add an XYZ tile server to your Laravel application
==================================================

[](#add-an-xyz-tile-server-to-your-laravel-application)

[![Latest Version on Packagist](https://camo.githubusercontent.com/32c6610c266c60664da4c4e659b51b9b7cc377ec3cc6ecea6695baaa0bcb773a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465616d7a61632f6c61726176656c2d74696c657365727665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/teamzac/laravel-tileserver)

This is a small package that allows your Laravel application to provide an XYZ tile server using .mbtiles datasets as the source. It was inspired by [maptiler/tileserver-php](https://github.com/maptiler/tileserver-php), which was helpful for understanding the minimum requirements, but is kind of a mess and not something you'd want to drop into an existing project.

However, this package is built for our particular use case and is not as full-featured as the one linked above. It only handles .mbtiles files and metadata validation is less robust because we have more control over the creation of the source data. It might be expanded in the future if our needs change. But if you just want to serve your own mbtiles as a vector layer for Mapbox or something, feel free to give it a shot!

More Info
---------

[](#more-info)

You can use [Tippecanoe from Mapbox](https://github.com/mapbox/tippecanoe) to create your own mbtiles datasets from GeoJSON, CSV, and other file formats.

Various mapping libraries allow you to add custom layers. Consult the appropriate documentation to learn how each one handles them.

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

[](#installation)

You can install the package via composer:

```
composer require teamzac/laravel-tileserver
```

It requires Laravel 8+.

Usage
-----

[](#usage)

The package is pretty simple to use. The service provider is auto-discovered. You can publish the config file or simply override the three settings (see below) with environment variables.

Then, simply register the routes in a routes file or RouteServiceProvider:

```
Route::tileserver();
```

If you'd like to wrap certain middlware around the routes, such as authentication middleware, you can do so:

```
Route::middleware('auth')->group(function() {
    Route::tileserver();
});
```

This will expose two routes to your app (or three, if you choose):

### /tileserver/{tileset}/{z}/{x}/{y}.pbf

[](#tileservertilesetzxypbf)

This is the tile template you can use in your custom map layers.

### /tileserver/{tileset}.json

[](#tileservertilesetjson)

This is a JSON endpoint that returns the metadata for all available tilesets. You can choose whether to hide this route in the config file.

### /tileserver/tilesets.json

[](#tileservertilesetsjson)

You can also expose this route to provide a JSON endpoint showing all available tilesets. By default, this is turned off. See the Configuration section for more details.

Configuration
-------------

[](#configuration)

Three configuration settings are provided:

1. Where your .mbtiles data files are stored
2. What route prefix to use for your endpoints
3. Whether to expose the JSON endpoint listing all available tilesets

You can set all of these via environment variables, or publish the config file and manage them there.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Chad Janicek](https://github.com/teamzac)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fd7317d975889db1c4dc0aec0dfcd3f9f4e284634e6719891d3f47f46238be6?d=identicon)[teamzac](/maintainers/teamzac)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/teamzac-laravel-tileserver/health.svg)

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

PHPackages © 2026

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