Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Addressable Bundle Laravel Package

daa/addressable-bundle

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Symfony-Centric: The bundle is tightly coupled to Symfony’s ecosystem (Doctrine, Twig, Form component), making it a natural fit for Symfony-based applications but non-trivial for Laravel without abstraction layers.
  • Geo-Spatial Core: Provides a distance-calculation service, radius-based queries, and address validation—useful for location-aware features (e.g., delivery apps, real estate).
  • Entity-Driven: Requires Doctrine entities with latitude/longitude fields, which may conflict with Laravel’s Eloquent ORM unless adapted.

Integration Feasibility

  • High for Symfony: Zero effort if already using Symfony; leverages existing form types, services, and Doctrine.
  • Moderate for Laravel: Requires wrapper classes to bridge Symfony’s Form, Twig, and Doctrine with Laravel’s FormRequest, Blade, and Eloquent.
    • Form Handling: Symfony’s FormType → Laravel’s FormRequest or custom FormServiceProvider.
    • Twig Templates: Replace with Blade directives or a Twig bridge (e.g., spatie/laravel-twig).
    • Geo-Spatial Logic: Extract distance/radius services into Laravel service containers (e.g., GeoService).

Technical Risk

  • Deprecation Risk: Last release in 2018—may not support modern Symfony (6.4+/7.x) or PHP 8.2+. Forking or rewriting may be needed.
  • ORM Mismatch: Doctrine-specific logic (e.g., Spatial functions) won’t port cleanly to Eloquent. Workarounds:
    • Use PostGIS (via spatie/laravel-postgis) for geo-queries.
    • Reimplement distance logic in Eloquent scopes or raw SQL.
  • Dependency Bloat: Pulls in Symfony components (e.g., symfony/form, symfony/twig-bridge) that Laravel may already handle differently.

Key Questions

  1. Is Symfony interoperability a blocker?
    • If the team is Symfony-first, adopt as-is. If Laravel-only, assess rewrite effort.
  2. What’s the geo-query strategy?
    • Can PostGIS/Eloquent handle radius searches without the bundle’s services?
  3. Is maintenance sustainable?
  4. Do we need the Google Maps form?
    • If yes, integrate via JavaScript libraries (e.g., google-maps-services) instead of the bundle’s Twig/FormType.

Integration Approach

Stack Fit

Symfony Laravel Equivalent Integration Strategy
FormType (Google Maps) FormRequest + JS library (e.g., vue-google-maps) Replace Twig template with Blade + JS; use Laravel’s Request validation.
Doctrine + Spatial Eloquent + PostGIS or raw SQL Abstract geo-queries into a GeoRepository trait.
Twig templates Blade or spatie/laravel-twig Override templates or use Blade directives.
GeoService (distance) Custom Laravel service Reimplement logic in a GeoDistanceCalculator.

Migration Path

  1. Phase 1: Core Geo Logic

    • Extract distance/radius calculations into a Laravel service (e.g., app/Services/GeoService.php).
    • Use PostGIS for spatial queries (if needed) or Eloquent scopes.
    • Example:
      // Laravel service (replaces Symfony's GeoService)
      class GeoService {
          public function distanceInKm(float $lat1, float $lon1, float $lat2, float $lon2): float {
              // Haversine formula
          }
      
          public function nearbyEntities(Entity $reference, float $radiusKm): Collection {
              return Entity::whereRaw("ST_DWithin(ST_GeomFromText('POINT($reference->longitude $reference->latitude)'), ST_GeomFromText('POINT(longitude, latitude)'), $radiusKm * 1000)")
                          ->get();
          }
      }
      
  2. Phase 2: Form Integration

    • Replace the Google Maps FormType with a Laravel form request + JavaScript (e.g., Google Maps API).
    • Example:
      // Laravel FormRequest
      class StoreAddressRequest extends FormRequest {
          public function rules(): array {
              return [
                  'latitude' => 'required|numeric',
                  'longitude' => 'required|numeric',
                  'address' => 'required|string',
              ];
          }
      }
      
    • Use Blade for rendering:
      <input type="text" name="address" id="address" data-lat="{{ old('latitude') }}" data-lng="{{ old('longitude') }}">
      <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=initAutocomplete"></script>
      
  3. Phase 3: Template Replacement

    • Replace Twig templates with Blade or use spatie/laravel-twig if Twig is mandatory.
    • Example Blade directive for form fields:
      @directive('addressableField', $field)
          <div class="form-group">
              <label>{{ $field->label }}</label>
              <input type="text" name="{{ $field->name }}" value="{{ old($field->name) }}">
          </div>
      @enddirective
      

Compatibility

  • Symfony 5/6: May work with minor tweaks (e.g., dependency updates).
  • Laravel 9/10: Not natively compatible—requires abstraction or rewrite.
  • PHP 8.2: Bundle may fail due to deprecated functions (e.g., create_function).

Sequencing

  1. Audit Dependencies: Check if daa/addressable-bundle conflicts with existing Laravel packages (e.g., symfony/form).
  2. Prototype Geo Logic: Build a minimal GeoService in Laravel to validate functionality.
  3. Replace Forms: Integrate Google Maps via JS before migrating Twig templates.
  4. Deprecate Bundle: Once all features are ported, remove the bundle entirely.

Operational Impact

Maintenance

  • High Risk: Abandoned since 2018; no security updates or Symfony 6+ compatibility.
    • Mitigation:
      • Fork the repo and update dependencies (e.g., symfony/form:^6.0).
      • Replace with Laravel-native alternatives (e.g., spatie/laravel-geo).
  • Dependency Overhead: Pulls in Symfony components that may duplicate Laravel’s functionality (e.g., form handling).

Support

  • Limited Community: 6 stars, 0 dependents → no ecosystem support.
  • Debugging: Symfony-specific errors (e.g., Twig_Environment) will require cross-framework knowledge.
  • Alternatives:
    • Laravel: Use spatie/laravel-geo + google/maps-services.
    • Symfony: Stick to the bundle or upgrade to stof/doctrine-extensions for spatial queries.

Scaling

  • Geo Queries: PostGIS or Eloquent spatial scopes will scale better than Doctrine-specific logic in Laravel.
  • Form Handling: JavaScript-based address input (e.g., Google Maps API) scales independently of backend changes.
  • Performance: Distance calculations are O(1); radius queries may need database indexing (PostGIS GIST).

Failure Modes

Risk Impact Mitigation
Bundle incompatibility with PHP 8.2 Breaks installation Fork and update dependencies.
Doctrine-specific queries Fails in Eloquent Rewrite using PostGIS or raw SQL.
Abandoned maintenance Security vulnerabilities Replace with maintained packages (e.g., spatie).
Twig template reliance Frontend rendering issues Use Blade or spatie/laravel-twig.

Ramp-Up

  • Symfony Teams: Low effort—follow existing docs.
  • Laravel Teams: Moderate-High effort (~2–4 weeks for full rewrite).
    • Steps:
      1. Week 1: Port geo-services to Laravel.
      2. Week 2: Replace forms with JS + Blade.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky