Weave 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

Laravel Repository Laravel Package

reallyli/laravel-repository

A Laravel repository pattern package that separates data access from business logic through interfaces and Eloquent-backed implementations, helping keep controllers and services clean, testable, and easy to swap or mock.

View on GitHub
Deep Wiki
Context7

Getting Started

The 1.0.6 release is a compatibility release: it adds Laravel 6.x support to a package that was previously constrained to earlier framework versions. Nothing about the package's public API is described as changing, so treat 1.0.6 as "the version you must be on if the host app is Laravel 6" rather than a feature upgrade.

Minimal steps on a Laravel 6 app:

composer require <vendor>/<package>:^1.0.6
php artisan vendor:publish --provider="<Vendor>\<Package>\<Package>ServiceProvider"

Then verify three things before writing any code:

  1. Composer resolution. composer show <vendor>/<package> and confirm the installed version is 1.0.6+ and that its laravel/framework constraint resolved to ^6.0. If you are on Laravel 6 and Composer still pulls 1.0.5 or lower, your root composer.json has a conflicting pin.
  2. Registration. Check the package's composer.json for extra.laravel.providers / extra.laravel.aliases (auto-discovery). If absent — common for packages that predate 5.5 — add the provider to config/app.php manually.
  3. Config. Read the published file in config/ and diff the keys against the README. Defaults are usually sane; env-driven keys are what you actually want to set per environment.

Where to look first, in order: the README (installation + a usage sample), src/ for the service provider (what gets bound into the container, what is registered as a singleton), the config file (the real surface area), and tests/ (which Laravel version the suite actually runs against, and whether a matrix includes 6.x).

First use case: pick the single smallest operation the package exposes — one facade call, one helper, or one console command — and run it from php artisan tinker on a clean Laravel 6 install. That isolates "does 1.0.6 work on 6.x at all" from "does it work inside my app's config and service providers."

Note that the changelog entry is a single line; it does not say whether the package dropped Laravel 5.x support to add 6.x, nor whether internal code was reworked for Laravel 6's helper changes. Confirm both against composer.json and the diff between the 1.0.5 and 1.0.6 tags.

Implementation Patterns

Resolve from the container, never new. Laravel 6 packages almost always bind an interface or a configured singleton in the provider. Injecting the contract (constructor injection in a controller, job, or command) is what makes config values, HTTP client options, and test doubles take effect. Instantiating the concrete class yourself silently bypasses all of it.

Publish config, then drive it from env. Set keys in .env and reference them via env() only inside config/. After changing config in a deployed environment, php artisan config:cache must be re-run — this is the single most common reason a package "ignores" new settings.

Wrap it in one thin adapter of your own. Even a single class like App\Services\<Domain>Service that composes the package and exposes two or three methods pays for itself at the next major upgrade: the blast radius of an API change is one file instead of every call site. It also gives you a seam for ->fake()-style testing.

Hook events instead of forking. If the package dispatches events or exposes lifecycle callbacks, register listeners in your own EventServiceProvider. Reaching into vendor code or extending an internal class creates a merge conflict on every patch release.

Test against 6.x explicitly. With a compatibility release, the risk profile is "worked on 5.8, subtly broken on 6.x." Run your integration test that exercises the package on the actual Laravel version you deploy. Where the package ships a fake or an in-memory driver, use it; otherwise $this->app->instance(Contract::class, $mock) in a test service provider.

Publish migrations deliberately. If the package ships migrations, publish them rather than relying on loadMigrationsFrom so you own the schema and can sequence them against your own. Run php artisan migrate --pretend first in production.

Pin with a caret, upgrade with a diff. ^1.0.6 is appropriate; it accepts future 1.x patches without re-admitting older incompatible releases, and it documents in composer.json that Laravel 6 is a supported target.

Gotchas and Tips

The Laravel 6 helper extraction is the big one. str_*, array_*, camel_case, snake_case, str_slug, and friends moved out of the framework into laravel/helpers. Package code or examples copied from a pre-6 tutorial will throw Call to undefined function. If you hit this, prefer rewriting to Str:: / Arr:: over installing the shim, and check whether the package's own internal helpers were actually updated or only its composer.json constraint was bumped.

Laravel 6 is the first semver release. Framework constraints must be ^6.0 (or >=5.5 <7.0 for a package spanning both). A package that still requires 5.8.* will not install alongside Laravel 6 no matter what its changelog claims — Composer will tell you, and composer why-not <vendor>/<package> 1.0.6 will name the conflicting requirement.

PHP floor is 7.2 on Laravel 6. Arrow functions (7.4) and typed properties (7.4) are not available to the package's own source. If you are extending a package class, don't assume 7.4 syntax is safe in a file that must run under the package's declared constraints.

Config caching breaks closures. If the published config contains a closure and you run config:cache, the app fails on boot with an unhelpful serialization error. Move callbacks into a service provider.

After any upgrade, clear the discovery cache: php artisan package:discover (or just composer dump-autoload). A stale bootstrap/cache/packages.php produces "class not found" errors that look like a broken install but are not.

php artisan about does not exist on Laravel 6 (it arrived in 7.x). Use php artisan --version plus composer show for diagnostics.

Debugging checklist when 1.0.6 misbehaves on 6.x: (a) log the resolved config with Log::debug(config('<package>')); (b) confirm the provider is discovered via php artisan package:discover -v; (c) composer show <vendor>/<package> --all to see the exact constraint set; (d) drop to the version immediately before the release and see if the failure reproduces — that attributes the bug to the compatibility change or to your integration.

Extension points, in order of safety: published config → published views/migrations → event listeners → container bindings overriding the package's contract after the package provider registers (register yours later in config/app.php, or in AppServiceProvider::register() with a comment explaining the override) → subclassing. Avoid editing vendor/; if you must patch, use cweagans/composer-patches so the fix survives composer update.

Known unknown: the release notes do not state whether Laravel 5.x support was retained. Before adopting 1.0.6 across projects on mixed framework versions, verify the illuminate/* constraints in composer.json — a "support" release can easily be an implicit drop of older versions.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator