- How do I install `dontdrinkandroot/common` in a Laravel project?
- Run `composer require dontdrinkandroot/common` in your project directory. The package is lightweight and requires PHP 8.1+, which aligns with Laravel 9/10+. Verify compatibility with your `composer.json` constraints to avoid dependency conflicts.
- Does this package replace Laravel’s built-in helpers like `Str::`, `Arr::`, or `File::`?
- No, it’s designed to complement Laravel’s helpers. It offers additional utilities (e.g., advanced file operations, custom string manipulations) where Laravel’s built-ins fall short. Always benchmark performance against native alternatives before adoption.
- Is `dontdrinkandroot/common` safe for production use in Laravel?
- The package lacks visible tests or benchmarks, raising reliability concerns. Run static analysis (PHPStan, Psalm) and consider a pilot phase in a non-critical module. Monitor maintainer activity—its 0-star status suggests higher abandonment risk.
- Can I use the PHPStan extension from this package in Laravel?
- Yes, the package includes a PHPStan extension for static analysis. Integrate it by configuring PHPStan’s `extension-classes` in your project’s `phpstan.neon`. Ensure your Laravel project’s PHPStan setup supports custom extensions.
- Will this package work with Laravel 8.x or older versions?
- The package targets PHP 8.1+, which aligns with Laravel 9/10+. For Laravel 8.x, you may need polyfills or a custom wrapper layer. Test thoroughly, as backward compatibility isn’t guaranteed without additional effort.
- Are there alternatives to `dontdrinkandroot/common` for Laravel?
- Yes, consider `spatie/array-to-object` for array conversions, `nunomaduro/collision` for utility functions, or Laravel’s native `collect()`, `Str::`, and `File::` helpers. Evaluate whether the package’s features justify its risks over existing solutions.
- How do I integrate these helpers globally in Laravel (e.g., as Facades or service bindings)?
- Since the package lacks Laravel-specific bindings, create a custom service provider to register helpers globally. Bind them to Laravel’s IoC container (e.g., `app()->bind(StringHelper::class, fn() => new StringHelper())`) and use dependency injection.
- Does this package support Blade directives or custom views?
- The package doesn’t explicitly mention Blade support. If you need Blade helpers, you’ll need to manually register them in a service provider or create a facade. Test for conflicts with Laravel’s `@stack`, `@push`, etc.
- How can I mitigate the risk of this package being abandoned?
- Start with a wrapper layer to abstract the package’s functionality, allowing easy swapping if needed. Document package-specific functions in your codebase for future migration. Consider internalizing critical helpers if maintenance stops.
- Are there performance benchmarks comparing this package to native PHP/Laravel helpers?
- No benchmarks are provided in the package’s documentation or repository. Run your own performance tests (e.g., using `php-benchmark`) to compare against Laravel’s built-in helpers or native PHP functions before adoption.