spotlibs/php-lib
A lightweight PHP library from Spotlibs providing reusable utilities and helpers for common development tasks. Built for easy integration into Laravel or standalone PHP projects, it aims to reduce boilerplate with simple, dependency-light components. See the repository for available features and usa...
composer require spotlibs/php-lib:^1.8 (or pin 1.8.2 exactly — see Gotchas). The package targets Laravel/PHP; if it ships a service provider, package discovery registers it automatically, so check composer.json → extra.laravel.providers before manually adding anything to config/app.php.v1.8.2 are a single line (fix : revert to old allFiles), so the only reliable source of truth is src/ (the class exposing allFiles), the tests/ directory (each test there documents intended behaviour better than the README), and the diff of v1.8.1...v1.8.2. Read the diff before you read the docs.php artisan vendor:publish --provider="Spotlibs\...ServiceProvider") and any migrations the package ships. For a file-oriented library, storage disk names and path conventions are the two things you most often need to override.allFiles (or resolve it from the container), point it at a model/storage disk, and call allFiles() to get the full set. Assert the result shape in a test immediately — per the changelog, that method's semantics are the part that just changed.$files = app(YourFileOwner::class)->allFiles();
dump(get_class($files), $files->count(), $files->first());
App\Support\FileCollection) around allFiles() so a future revert or rename touches one file:
class FileCollection
{
public function __construct(private YourFileOwner $owner) {}
public function all(): Collection
{
return collect($this->owner->allFiles())->values();
}
}
allFiles() returns (array, Collection, SplFileInfo[], path strings), convert to a stable, typed representation once and pass only that downstream. Ordering and keying are exactly the kind of detail that shifts between patch releases.$this->app->bind(FileCollection::class, ...)) rather than new-ing it up. This gives you a single seam to swap behaviour in tests and to feature-flag the v1.8.1 vs v1.8.2 semantics if you need to compare.1.8.1, upgrade in an isolated branch: composer require spotlibs/php-lib:1.8.2 --with-dependencies, then run the tests that touch file listing. Keep composer.lock committed; a revert is invisible in a diff review but very visible at runtime.config/filesystems.php) and never hardcode storage_path() paths in call sites. That way test suites can point at a Storage::fake() disk and exercise the real allFiles() code path.v1.8.2 reverts allFiles to the old implementation. Anyone who adapted to v1.8.1's output — different ordering, filtering of hidden/nested files, or a changed return type — will silently regress. Semver alone will not protect you here; treat ^1.8 as optimistic and prefer an exact pin with a deliberate bump.git diff v1.8.1 v1.8.2 -- src/ is a 30-second job that saves an incident. Note the discrepancy between the changelog wording and the branch/PR numbering (#70) — verify the tag actually contains the commit you think it does (composer show spotlibs/php-lib).E_USER_DEPRECATED or upgrade guide to catch you. Your only signal is your own test suite — so make sure one exists before upgrading.(new ReflectionClass($owner))->getFileName()) to confirm which vendor version Composer actually loaded — stale vendor/ or an opcache/composer dump-autoload lag is a common false alarm. Then composer why spotlibs/php-lib to check no transitive dependency is pulling a conflicting constraint.allFiles. Until the maintainer stabilises it, keep your pinned version under review and add a CHANGELOG-watching note (or a Dependabot rule that opens a PR rather than auto-merging patch bumps for this package specifically).How can I help you explore Laravel packages today?