Download the PHP package siberfx/backpack-leaflet-drawjs without Composer

On this page you can find all versions of the php package siberfx/backpack-leaflet-drawjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package backpack-leaflet-drawjs

Leaflet Draw field for Backpack

Draw polygons on a Leaflet map (Mapbox or OpenStreetMap) and store them as GeoJSON, as a Laravel Backpack 7.x CRUD field.

Tests Latest Version Total Downloads PHP Version Laravel Backpack

Leaflet Draw field preview

Features

Requirements

Package Version
PHP 8.2, 8.3, 8.4, 8.5
Laravel 12.x, 13.x
Backpack/CRUD 7.x

Using Backpack 6.x? Install the 1.x line: composer require siberfx/backpack-leaflet-drawjs:^1.3

Installation

The service provider is auto-discovered, and the leaflet-draw field type works straight away.

Optionally add a Mapbox token to your .env. Without one, the field uses OpenStreetMap tiles:

Usage

1. Add a column that can hold JSON

2. Cast the attribute on your model

3. Add the field to your CrudController

That's all you need. Backpack saves the GeoJSON with the rest of the form, so you don't need a custom route or controller.

Field options

Every option is optional. Anything you leave out falls back to config/backpack/leaflet-draw.php.

Stored data

With multiple => false (the default), the field stores a single GeoJSON Feature:

With multiple => true, it stores a FeatureCollection. When every shape is deleted, the field stores an empty value.

Configuration

To change the defaults, publish the config file:

To customize the field markup, publish the view. It is copied to resources/views/vendor/backpack/crud/fields/leaflet-draw.blade.php:

Use --tag="all" to publish both.

Upgrading from 1.x

Testing

The PHP suite boots a real Backpack 7 app (Tabler theme) with Orchestra Testbench. It renders the create and edit pages and saves polygons through Backpack. The JavaScript suite runs the field script against real Leaflet and Leaflet.draw in jsdom.

GitHub Actions runs both suites on every push and pull request: PHP 8.2 to 8.5 on Laravel 12, and PHP 8.3 to 8.5 on Laravel 13.

Changelog

See CHANGELOG.md.

Security

If you find a security issue, please email [email protected] rather than opening a public issue.

Credits

License

MIT. See LICENSE.md.


All versions of backpack-leaflet-drawjs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
backpack/crud Version ^7.0
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package siberfx/backpack-leaflet-drawjs contains the following files

Loading the files please wait ...