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.
Pros:
Arr::flattenKeys()).Arr, Str, File, Digit helpers) maps naturally to Laravel’s service layer or utility layer, reducing coupling.Arr::of()->count()) support fluent interfaces, improving readability in Laravel’s query builder-style syntax.Cons:
MockFacade or partialMock).collect(), Str::of()) without conflicts.Arr helper for global array operations).Arr::count()).DragonCode\Support\Arr, DragonCode\Support\Str) work independently.| 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. |
Adoption Scope:
app/Helpers/ArrayHelper.php) or third-party packages (e.g., spatie/array)?Arr::pluck() vs. Laravel’s collect()->pluck())?Testing Strategy:
Maintenance:
Alternatives:
Str::of(), collect()) and Spatie packages (e.g., spatie/array).nette/utils for non-Laravel PHP).Onboarding:
app/Support/Arr.php)?| 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. |
Assessment Phase:
app/Helpers/) and third-party helpers (e.g., spatie/array).Arr::flattenKeys(), Str::slugify()) to replace.Pilot Integration:
composer require dragon-code/support --dev
config/app.php:
'aliases' => [
'Arr' => DragonCode\Support\Facades\Arr::class,
// ... other facades
],
Arr::pluck() → Arr::of($array)->pluck()).Gradual Rollout:
Arr, Str).File::load(), Directory::copy()).Deprecation Strategy:
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 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. |
Critical Path:
Parallel Tasks:
Arr::of() vs. collect()").How can I help you explore Laravel packages today?