friendsofvictoire/gmap-widget
friendsofvictoire/gmap-widget provides a reusable Laravel widget for rendering interactive Google Maps in Blade views, with configurable markers, zoom, map type, and simple setup for adding location maps to your application.
This is not a Laravel package — it is a Symfony bundle that plugs a Google Maps widget into Victoire DCMS, a Symfony 2/3-era visual CMS. There is no service provider, facade, config publish, or Blade view. As a Laravel developer your realistic options are (a) run it inside a legacy Victoire/Symfony app, or (b) use it as a reference implementation and port the concept to Blade + a JS map component.
Minimal steps to get it running in its native habitat:
composer require friendsofvictoire/gmap-widget in the Victoire application.app/AppKernel.php (Symfony 2/3 style; there is no Flex recipe).doctrine:schema:update (or a migration) so the widget's entity table exists.Where to look first, in the repository:
WidgetGmapBundle.php) — shows how the widget is registered with Victoire.Entity/WidgetGmap.php — the persisted fields you can extend (address, latitude, longitude, zoom, and similar).Form/WidgetGmapType.php — the editor-side form; this is your hook for adding fields or validation.Resources/views/WidgetGmap/*.twig — the front-end template that actually emits the Google Maps JavaScript and the map container.First real use case: an editor drops a map into a "Contact" page and sets the address in the widget form; the page renders a map centered on that address. Everything after that is template overrides and API-key plumbing.
The package is a classic Victoire widget triad — entity + form type + Twig template — registered through the bundle. Day-to-day work happens in three places:
Editor configuration. The widget form is the only thing content editors see. Add fields (map type, marker icon, height, "show directions" toggle) to WidgetGmapType and persist them on the widget entity. Keep the form focused: editors should not be typing raw JSON for map options.
Template override, not fork. Victoire resolves widget templates through Twig namespaces. Override the widget's template in your application (typically under app/Resources/VictoireWidgetGmapBundle/views/... in Symfony 2/3, or in your own bundle) to change markup, container IDs, CSS classes, and the JavaScript initializer. This is the main lever you have and avoids maintaining a fork.
Server-side geocoding. The 2016 code predates the era where client-side geocoding without a key was tenable. Geocode the address on save (form event or Doctrine listener) and store latitude/longitude, so rendering is a pure template render and never depends on a browser-side geocoder that can rate-limit or fail.
API key injection. Wire the Google Maps key through Symfony parameters/config.yml and pass it into the Twig template. Do not hardcode it in the widget template.
Rendering pattern. Victoire renders widgets inside page slots; the widget's Twig template owns the map container and the init script. If a page can hold more than one map, the initializer must use a per-widget unique DOM id (see gotchas).
Porting to Laravel (the practical path for most readers). Treat this bundle as a specification, not a dependency: a Blade component (<x-google-map :lat :lng :zoom />), a Livewire/Filament form for the editor fields, a config/services.php entry for the key, and a small JS module (Alpine.js or vanilla) that instantiates the map. You lose Victoire's drag-and-drop editor, but you keep the field model and template shape the bundle demonstrates.
Map JavaScript API behavior changed repeatedly after 2016. The bundled template almost certainly does not include a key parameter; add one and restrict it by HTTP referrer in Google Cloud Console.#map, two widgets on one page will silently render only one map. Make the id derive from the widget's id/uid.doctrine:schema:update/migrations produces confusing save failures in the Victoire editor rather than an obvious error.debug:container / debug:event-dispatcher on the era-appropriate Symfony version) rather than the form.How can I help you explore Laravel packages today?