api.gouv) can be extracted and adapted for Laravel.SearchAddress, AddressTrait) require significant refactoring or replacement.bundles.php, console commands). A Laravel TPM should evaluate whether the address validation/API logic can be decoupled into a standalone PHP library or microservice.api.gouv (French government address API). If the goal is to replicate this functionality in Laravel, the TPM should:
HttpClient) and port it to Laravel’s Http facade or a similar client.make:address command generates Twig templates for autocompletion. Laravel TPMs must decide between:
spatie/symfony-laravel-bridge), though this adds complexity.symfony/console, twig/twig) requiring polyfills or replacements.AddressTrait) needing adaptation to Laravel’s service container or model traits.make:address) requiring rewrite for Laravel’s Artisan or a custom CLI tool.api.gouv introduces external risk. The TPM should:
api.gouv’s API contracts (endpoints, rate limits, response formats) are stable.laravel-address, geocoder-php)?api.gouv provide unique value (e.g., French-specific compliance, official data) that justifies the effort?make:address functionality?api.gouv or the bundle? Will forks be necessary?Http client instead of Symfony’s HttpClient.laravel-address or integrate a frontend library (e.g., Postal.js).geocoder-php with Laravel’s service container.api.gouv logic.// Laravel Service Provider (app/Providers/AddressServiceProvider.php)
public function register()
{
$this->app->singleton(AddressApiClient::class, function () {
return new AddressApiClient(config('services.api_gouv.key'));
});
}
// app/Facades/Address.php
public function validate(string $address): bool;
public function geocode(string $address): array;
<x-address-autocomplete
wire:model="address"
api-endpoint="{{ config('services.api_gouv.endpoint') }}"
/>
Address, PostalCode).Schema::create('addresses', function (Blueprint $table) {
$table->id();
$table->string('street');
$table->string('postal_code');
$table->string('city');
$table->string('country')->default('FR');
$table->json('coordinates')->nullable();
$table->timestamps();
});
api.gouv data.bundles.php, Twig templates, and console commands require rewrites.symfony/console). Use Laravel’s equivalents.| Symfony Dependency | Laravel Alternative |
|---|---|
symfony/http-client |
Laravel Http client |
twig/twig |
Blade or frontend framework |
symfony/console |
Artisan or custom CLI |
api.gouv integration.api.gouv for breaking changes.api.gouv fails).Http, Cache).composer.json constraints:
"require": {
"guzzlehttp/guzzle": "^
How can I help you explore Laravel packages today?