Source: bojithapiyathilake.medium.com

Saving a Map Layer using LeafletJS, Laravel and MySQL.

Category: Laravel, MySQL, javascript

First let me lay out what I will be trying to demonstrate through this article.

At this point in time, I was using Laravel for the backend and blade/bootstrap for the frontend.

On line 57, the layer is added to the map and on line 58, we are saving the details of the layer to the input field. Now when we click on the submit button, the layer details will be sent to the Laravel controller as if it is a normal input and it can be saved to the database.

Now what we want to do is retrieve the layer from the database and input it to a leaflet layer which can be displayed on the map.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners