rareloop/primer-core
Core foundation package for the Primer framework, providing shared utilities, service providers, configuration, and base classes used across Rareloop's Laravel/PHP packages. A lightweight starting point for building consistent applications and add-ons.
rareloop/primer-core is the framework layer behind Rareloop's Primer stack: it brings Laravel's Illuminate building blocks (collections, container/config, support helpers) into a non-Laravel host application, so day-to-day work feels like writing Laravel service code rather than raw PHP.
Minimum steps to get productive:
composer require rareloop/primer-core — with v5.2.0 you can now resolve against illuminate/collections v11 alongside v10, so let Composer pick based on your PHP version rather than hand-pinning.composer show illuminate/collections. That single line tells you whether you're on the PHP 8.2+/Laravel 11 track or the PHP 8.1/Laravel 10 track.collect() chain. It's zero-risk, exercises the collection version you just installed, and confirms the package is wired correctly before you touch container bindings.If you are starting fresh, don't reach for the container or service providers on day one — collections and helpers are the lowest-friction surface and where most of the value is.
Collections as the default data layer. Treat collect() as the boundary between your data source and your templates. Fetch (query, API, config), then map/filter/groupBy into a shape the template can render without conditionals. This keeps view logic declarative and makes the Illuminate version bump in 5.2.0 a non-event for your code.
Container bindings for cross-cutting concerns. Register shared services (config readers, HTTP clients, view renderers) once in the bootstrap/provider layer and resolve them by interface downstream. The payoff is testability: swap the binding in a test bootstrap rather than mocking globals.
Providers as the extension seam. Group registrations by feature (one provider per domain area) instead of a single monolithic bootstrap file. When you upgrade Illuminate majors, you can grep one provider at a time and validate it in isolation.
Version-agnostic code for the 5.2.0 window. If you maintain multiple sites on different PHP versions, write against the collection API common to v10 and v11 rather than branching on the installed version. The intersection is large; the differences are edge cases you can handle at the call site if you hit one.
Config over constants. Read tunables through the config layer so per-environment overrides work; hardcoded values in the bootstrap are the most common cause of "works locally, wrong in staging."
Integration tip: in a WordPress-hosted context, do the container bootstrap on a hook that fires early enough for providers but late enough that the host has loaded its own functions — mis-ordering here produces null dependencies that look like package bugs.
illuminate/collections v11 requires PHP 8.2+. If your host runs 8.1, Composer will silently resolve to v10 and you'll be reading v11 docs against v10 behaviour. Confirm the resolved version before debugging anything collection-related.primer-core itself didn't change.primer-core version can end up on different Illuminate majors. Pin with composer.lock in CI, and don't share a lock file between a PHP 8.1 and a PHP 8.2 deployment target.count(), repeated iteration, or dd(). If something looks empty in a debug dump but renders fine, that's usually a lazy collection being consumed once.null, log the provider registration order rather than the binding itself — the problem is almost always that the provider ran before its dependency existed.final or takes constructor dependencies from the container before committing to that approach.5.x bump here added a dependency major without touching the public API; assume the reverse is also possible and read release notes rather than inferring risk from semver drift.How can I help you explore Laravel packages today?