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

Support Laravel Package

dragon-code/support

Dragon Code Support provides a lightweight collection of PHP/Laravel helpers, facades, and utility tools for everyday projects. Designed to be easily extended with new methods or classes, with a clear contribution and testing structure.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Facade-based design aligns with Laravel’s service container and facade patterns, enabling clean, dependency-free usage (e.g., Arr::flattenKeys()).
    • Modular structure (e.g., Arr, Str, File, Digit helpers) maps naturally to Laravel’s service layer or utility layer, reducing coupling.
    • Lightweight (~10KB) with no external dependencies (beyond PHP core), making it ideal for microservices, CLI tools, or legacy system modernization.
    • Invokable methods (e.g., Arr::of()->count()) support fluent interfaces, improving readability in Laravel’s query builder-style syntax.
    • PHP 8.1+ compatibility ensures alignment with modern Laravel (10+) and PHP best practices (e.g., named arguments, attributes).
  • Cons:

    • No built-in Laravel service provider: Requires manual facade registration (minor overhead for small teams).
    • Limited domain-specific utilities: Focuses on generic helpers (e.g., string/array manipulation) rather than business logic (e.g., payment processing, auth).
    • Facades may obscure dependencies: Harder to mock in unit tests compared to direct class instantiation (mitigated by Laravel’s MockFacade or partialMock).

Integration Feasibility

  • Laravel Ecosystem:
    • Seamless facade integration: Works alongside Laravel’s built-in helpers (e.g., collect(), Str::of()) without conflicts.
    • Service container compatibility: Can be bound as singletons if needed (e.g., Arr helper for global array operations).
    • Testing: Supports Pest/PHPUnit via facades or direct class calls (e.g., Arr::count()).
  • Non-Laravel PHP:
    • Standalone usage: Facades require manual registration, but core classes (DragonCode\Support\Arr, DragonCode\Support\Str) work independently.
    • PSR-4 autoloading: Standard Composer setup ensures no path configuration issues.

Technical Risk

Risk Area Assessment Mitigation
Breaking Changes Active development (6.17.1 as of 2026) but no semantic versioning guarantees. Pin to specific version (e.g., 6.17.1) and monitor changelog.
Facade Dependency Facades may complicate testing/mocking. Use direct class calls in tests or MockFacade (Laravel 10+).
Performance Overhead Minimal (~10KB), but facades add 1–2ms per call (benchmark in CI). Profile critical paths; avoid facades in hot loops (use direct classes).
PHP Version Lock-in Requires PHP 8.1+ (Laravel 10+). Upgrade path is straightforward if using older PHP/Laravel.
Community Support 23 stars, 0 dependents → Low adoption risk but limited community help. Contribute fixes or fork if critical issues arise.
License Compatibility MIT license → Compatible with AGPL, GPL, proprietary projects. No restrictions.

Key Questions for TPM

  1. Adoption Scope:

    • Will this replace custom utility classes (e.g., app/Helpers/ArrayHelper.php) or third-party packages (e.g., spatie/array)?
    • How will naming conflicts be handled (e.g., Arr::pluck() vs. Laravel’s collect()->pluck())?
  2. Testing Strategy:

    • Should facades be mocked in unit tests, or will direct class calls suffice?
    • Will integration tests verify facade behavior in Laravel’s service container?
  3. Maintenance:

    • Who will triage updates (e.g., PHP 8.3 compatibility)?
    • Will the team contribute fixes or fork if the package stagnates?
  4. Alternatives:

    • Compare with Laravel’s built-in helpers (e.g., Str::of(), collect()) and Spatie packages (e.g., spatie/array).
    • Evaluate performance vs. alternatives (e.g., nette/utils for non-Laravel PHP).
  5. Onboarding:

    • How will the team standardize usage (e.g., documentation, coding guidelines)?
    • Will internal wrappers be created for critical methods (e.g., app/Support/Arr.php)?

Integration Approach

Stack Fit

Component Fit Level Notes
Laravel 10–13 ✅ Excellent Explicit compatibility; facades integrate with Laravel’s service container.
PHP 8.1–8.4 ✅ Excellent Minimum PHP 8.1; tested up to PHP 8.4.
Symfony Components ⚠️ Partial No Symfony dependencies (removed polyfill-php81 in v6.17.1), but may conflict with existing Symfony packages.
Non-Laravel PHP ✅ Good Core classes work standalone; facades require manual setup.
CLI Tools ✅ Excellent Lightweight and dependency-free; ideal for scripts.
Microservices ✅ Excellent Minimal footprint; no framework lock-in.

Migration Path

  1. Assessment Phase:

    • Audit existing custom utilities (e.g., app/Helpers/) and third-party helpers (e.g., spatie/array).
    • Identify high-value methods (e.g., Arr::flattenKeys(), Str::slugify()) to replace.
  2. Pilot Integration:

    • Install in a non-production repo or feature branch:
      composer require dragon-code/support --dev
      
    • Register facades in config/app.php:
      'aliases' => [
          'Arr' => DragonCode\Support\Facades\Arr::class,
          // ... other facades
      ],
      
    • Replace 1–2 critical utility methods (e.g., Arr::pluck()Arr::of($array)->pluck()).
  3. Gradual Rollout:

    • Phase 1: Replace array/string helpers (e.g., Arr, Str).
    • Phase 2: Adopt filesystem utilities (e.g., File::load(), Directory::copy()).
    • Phase 3: Deprecate custom utility classes in favor of package methods.
  4. Deprecation Strategy:

    • Use Laravel’s deprecated() helper for custom methods:
      if (!function_exists('old_array_pluck')) {
          function old_array_pluck($array, $key) {
              deprecated('Use Arr::of($array)->pluck() instead.', '2024-01-01');
              return Arr::of($array)->pluck($key);
          }
      }
      

Compatibility

Compatibility Check Status Notes
Laravel 10–13 ✅ Supported Explicit compatibility in v6.16.0+ (Laravel 12) and v6.17.0 (Laravel 13).
PHP 8.1–8.4 ✅ Supported Minimum PHP 8.1; tested up to PHP 8.4.
Symfony 6–7 ⚠️ Test Required No direct dependencies, but Symfony components (e.g., HttpFoundation) may conflict.
Custom Autoloading ✅ Supported PSR-4 compliant; no path configuration needed.
Legacy PHP (7.4–8.0) ❌ Not Supported Minimum PHP 8.1 required.

Sequencing

  1. Critical Path:

    • Week 1: Install package, register facades, test in isolation.
    • Week 2: Replace high-impact utility methods (e.g., array/string operations).
    • Week 3: Integrate filesystem helpers (if needed).
  2. Parallel Tasks:

    • Documentation: Create internal docs for team adoption (e.g., "When to use Arr::of() vs. collect()").
    • Testing: Write integration tests for facade behavior
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata