You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Nafies Luthfi 7ecb83c330
Add Sponsorship
5 years ago
.github Add Sponsorship 5 years ago
app Use bootstrap pagination 5 years ago
bootstrap Install laravel 5.7.13 7 years ago
config Use env on map center coordinate config 7 years ago
database Upgrade to Laravel 6.0 6 years ago
public Update README.md 7 years ago
resources Remove unused lines 5 years ago
routes Set "/" to outlet map route 7 years ago
storage Install laravel 5.7.13 7 years ago
tests Update codebase and tests 5 years ago
.editorconfig Install laravel 5.7.13 7 years ago
.env.example Install laravel 5.7.13 7 years ago
.gitattributes Install laravel 5.7.13 7 years ago
.gitignore Install laravel 5.7.13 7 years ago
LICENSE Create LICENSE 7 years ago
README.md Update README.md 7 years ago
artisan Install laravel 5.7.13 7 years ago
composer.json Update to laravel 8.x 5 years ago
composer.lock Composer update to laravel v8.29.0 5 years ago
package.json Install laravel 5.7.13 7 years ago
phpunit.xml Update to laravel 8.x 5 years ago
server.php Install laravel 5.7.13 7 years ago
webpack.mix.js Install laravel 5.7.13 7 years ago

README.md

Laravel Leaflet JS - Example

This is an example project for Leaflet JS and OpenStreetMap built with Laravel 5.8.

Laravel Leaflet JS Project Example

Features

In this project, we have an Outlet Management (CRUD) with localtion/coordinate point that shown in map. We also have coordinate entry with direct map pointing on Outlet Create and Edit form.

Installation Steps

Follow this instructions to install the project:

  1. Clone this repo.
    $ git clone git@github.com:nafiesl/laravel-leaflet-example.git
    # or
    $ git clone https://github.com/nafiesl/laravel-leaflet-example.git
    
  2. $ cd laravel-leaflet-example
  3. $ composer install
  4. $ cp .env.example .env
  5. $ php artisan key:generate
  6. Set database config on .env file
  7. $ php artisan migrate
  8. $ php artisan serve
  9. Open https://localhost:8000 with browser.

Demo Records

If we need some outlet demo records, we can use model factory within tinker:

$ php artisan tinker
>>> factory(App\Outlet::class, 30)->create();

Leaflet config

We have a config/leaflet.php file in this project. Set default zoom level and map center coordinate here (or in .env file).

<?php

return [
    'zoom_level'           => 13,
    'detail_zoom_level'    => 16,
    'map_center_latitude'  => env('MAP_CENTER_LATITUDE', '-3.313695'),
    'map_center_longitude' => env('MAP_CENTER_LONGITUDE', '114.590148'),
];

Please note that this is not an official or required config file from Leaflet JS, it is just a custom config for this project.

Testing

Run PHPUnit to run feature test:

$ vendor/bin/phpunit

License

This project is open-sourced software licensed under the MIT license.