Manage places and show them on a map.
- Require the package using composer:
composer require typicms/places
- Add the service provider in your config/app.php file:
'providers' => [
/*
* TypiCMS Modules Service Providers.
*/
TypiCMS\Modules\Places\Providers\ModuleServiceProvider::class,
];
- Publish files from this module to your project, run:
php artisan vendor:publish --provider="TypiCMS\Modules\Places\Providers\ModuleServiceProvider"
- Run the migration:
php artisan migrate
-
Set a Google Maps API key in your .env file. See Google Maps Platform.
-
Install @googlemaps/markerclusterer and :
bun add @googlemaps/markerclusterer --dev
bun add @types/google.maps --dev
- Uncomment the following lines in
/resources/js/public.js
:
import initMap from './public/map';
window.initMap = initMap;
- Add this line to the
/resources/scss/public.scss
file:
@import 'public/map';
-
Run
bun run dev
to compile the assets. -
Connect to the admin panel, add some places, create a page linked to the module Places and visit this page to see the places on a map.
This module is part of TypiCMS, a multilingual CMS based on the Laravel framework.