oh/google-map-form-type-bundle
A Symfony bundle that adds a Google Maps form type for selecting locations directly in your forms. Let users pick a point on an interactive map and store latitude/longitude with minimal configuration. Ideal for address, venue, or geolocation fields.
Architecture fit — the framing is wrong. oh/google-map-form-type-bundle is a Symfony bundle, not a Laravel package. It provides a Symfony Form type (GoogleMapType) that renders a Google Map with a draggable marker and syncs the marker position into two form fields (latitude/longitude). There is no service provider, no config publishing, no Blade view, and no illuminate/* dependency. Under Laravel, the Laravel–Symfony Form bridge exists but is not a supported path for adding a bundle's Twig form theme to a Blade/Livewire stack. Net: on Laravel this is a reference implementation to port, not a dependency to install.
What is actually reusable. The durable value is small and mostly front-end: the JS glue that (a) initialises a map at a default lat/lng/zoom, (b) binds a draggable marker to two inputs, (c) updates inputs on dragend/click, and (d) handles the empty/partial-coordinate case. That is roughly 80–150 lines. The bundle wrapper around it is Symfony 2/3 ceremony.
Integration feasibility.
composer require this. Extract the JS, rebuild as a Blade component (optionally Alpine/Livewire), validate server-side with a FormRequest using numeric|between:-90,90 / between:-180,180 and an "either both or neither" rule.AbstractType::getName() removal, configureOptions() replacing setDefaultOptions(), Flex recipes, bundles.php, and Twig 2/3 form-theme changes. Expect a fork, not a version bump.Technical risk.
google.maps.Marker, deprecated in favour of AdvancedMarkerElement (which requires a Map ID). Expect the "For development purposes only" watermark or a console deprecation/error path on day one.AdvancedMarkerElement, no SSR/Inertia story.Key questions.
googlemaps/maps-style JS wrappers, Leaflet, MapLibre, or the Google Maps Web Components)?AdvancedMarkerElement?Stack fit. Not fit-for-purpose as a dependency on Laravel 10/11/12. Treat it as a design source: it encodes the correct field semantics (two numeric fields, map as an input affordance, marker as the source of truth on drag, inputs as source of truth on manual edit).
Migration path (recommended, Laravel).
<x-google-map-picker name="lat" lng-name="lng" :center="..." :zoom="..." /> with a Blade partial, a small vanilla JS or Alpine component, and the API key injected from config('services.google_maps.key').decimal(10,7)/decimal(11,7); reject partial coordinates; treat the client as advisory only.composer.json to ^6.4|^7, replace getName()/setDefaultOptions(), migrate the Twig theme to a form_theme, add a Flex recipe-style bundles.php entry, and pin symfony/form: ^6.4|^7.Compatibility checklist to verify before any fork effort.
composer.json PHP constraint and Symfony range (likely ~2.3|~3.0, PHP ≥5.3).AbstractType::getName() and setDefaultOptions() usage.Bundle without getPath()/Flex conventions.Sequencing. Spike (0.5d) → port JS to Blade/Alpine (1d) → key/config/CSP/consent wiring (0.5d) → validation + tests incl. empty-map and out-of-range cases (0.5–1d) → accessibility pass (keyboard marker movement, text-input fallback as the primary path) (0.5d). Budget 3–5 dev-days for a production-credible Laravel version; 1–2 days for an internal-only one.
Alternative to consider and price alongside. Leaflet or MapLibre + OSM tiles removes the API key, the billing relationship, and most of the consent complexity at the cost of geocoding quality. For a single lat/lng picker, this is frequently the better TPM call; Google earns its place only if you also want Places Autocomplete and Street View.
Maintenance. You inherit 100% of it. There is no upstream to patch Google API deprecations, and the 2016 cutoff means the first breakage has already happened. Treat every future Google Maps JS API change as your ticket.
Support. None. No issue triage, no security advisories, no release cadence. Internally, designate an owner for the map component — it is a small but permanently owned surface.
Scaling.
Failure modes to design for.
maps.googleapis.com → the text inputs must remain fully usable; the map is an enhancement.google.maps.Marker → marker may not render on the current API version.Ramp-up. Low for any front-end-capable developer — the concept is a two-input map picker, not novel. The cost is not learning it; it is re-deriving the deprecated-API fixes and writing the tests the package never had. Allocate the ramp-up budget to the port and the Google API migration, not to reading this repo's docs (there are effectively none).
How can I help you explore Laravel packages today?