cethyworks/google-place-autocomplete-bundle
symfony/form or laravel/symfony-bridge).FormType system may require abstraction layers for Laravel’s native form handling (e.g., Illuminate\Html\FormBuilder or collective/html).Form component (installable via composer require symfony/form).Form::open(), Form::text()) won’t natively support Symfony FormType; would need a facade or custom wrapper.Illuminate\Validation) and use the bundle’s API logic as a service.<input> with data-attributes for Google’s autocomplete JS.symfony/form and wrap the SimpleGooglePlaceAutocompleteType in a Laravel service.GooglePlaceAutocomplete service logic and rewrite it as a Laravel service (e.g., GooglePlacesService) using Guzzle for API calls.symfony/form installed.FormView).// Laravel Service (replaces bundle's logic)
class GooglePlacesService {
public function autocomplete(string $query, string $apiKey): array {
$response = Http::get('https://maps.googleapis.com/maps/api/place/autocomplete/json', [
'key' => $apiKey,
'input' => $query,
]);
return $response->json();
}
}
<!-- Blade with Google Autocomplete JS -->
<input type="text" id="address" data-google-api-key="{{ config('services.google.api_key') }}">
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
<script>
document.getElementById('address').addEventListener('input', (e) => {
const query = e.target.value;
// Call Laravel backend via fetch/XHR or use Google's JS library directly
});
</script>
symfony/form and test bundle’s FormType in isolation.$cacheKey = "google_places:{$query}";
return Cache::remember($cacheKey, now()->addMinutes(5), function () use ($query) {
return $this->googlePlacesService->autocomplete($query, config('services.google.api_key'));
});
log() or a dedicated dashboard (e.g., Laravel Nova).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Google API key revoked | Autocomplete breaks | Store backup keys in .env; rotate keys. |
| API quota exceeded | 503 errors | Implement fallback (e.g., static suggestions). |
| Symfony dependency conflicts | Bundle fails to load | Fork and update dependencies. |
| Bundle abandoned by maintainer | No future updates | Plan migration to Spatie’s package or custom solution. |
How can I help you explore Laravel packages today?