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

Makeservice Laravel Package

ikechukwukalu/makeservice

Laravel package that adds a make:service Artisan command to scaffold dedicated service classes, helping keep controllers and models lean by moving business logic into reusable, testable services. A lightweight way to organize application code and speed up development.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Verify runtime prerequisites first. v4.0.0 raises the floor to PHP 8.2 and adds Laravel 12 support. Before anything else, confirm your app's php constraint, your Docker/CI base image, and your laravel/framework version. Run php -v and php artisan about to see what you're actually on.
  • Read the upgrade surface, not just the release notes. A 4.0.0 major bump implies a breaking-change document. Check the repo for UPGRADE.md / CHANGELOG.md and the README's "Upgrading" section before running composer update. The release notes shown here only describe platform/tooling changes — verify there is nothing else in the tag diff (composer diff or the GitHub compare view between v3.x and v4.0.0).
  • Install and wire it up. Typical Laravel package flow:
    composer require <vendor>/<package>:^4.0
    php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider"
    php artisan migrate   # only if the package ships migrations
    
    Package discovery should register the service provider automatically; if not, add it to bootstrap/providers.php (Laravel 11/12 style) rather than the legacy config/app.php array.
  • Look here first: the published config/<package>.php (all tunables and their env var names), then the package's facade/contract — that's the contract you'll be coding against.
  • First use case: do one read and one write through the package's public API inside php artisan tinker, using a throwaway record. This validates credentials, migrations, and config in about two minutes before you build anything on top of it.

Implementation Patterns

  • Wrap the package behind your own thin service. Bind a small App\Services\... adapter that delegates to the package's facade/contract and resolve that from the container. When v5 lands you change one file, and your tests can swap in a fake without touching package internals.
    // AppServiceProvider::register()
    $this->app->bind(InvoiceGateway::class, fn ($app) => new PackageInvoiceGateway(
        $app->make(\Vendor\Package\Contracts\Client::class)
    ));
    
  • Configure via env → config, never inline. Keep all package config in config/<package>.php reading from env(), and add the keys to .env.example. Never call env() from application code — it returns null once config:cache runs.
  • Push long-running work to queues. Most packages that hit an external service or do IO should be invoked from a job with $tries, $backoff, and failed() handling. Use the package's events/webhooks as triggers rather than polling.
  • Prefer constructor injection over facades in anything you intend to test — facades are fine in controllers and tinker, painful in unit tests.
  • Test at the seam. Feature-test your adapter, not the package. For package-level work, Orchestra Testbench 10 is now the supported harness — update getPackageProviders() / defineEnvironment() in your base TestCase if you maintain the package or a fork.
  • Migrate tests to PHPUnit 11 attributes. Docblock annotations are gone; use #[Test], #[DataProvider('method')], #[Depends], #[Group]. Also confirm phpunit.xml uses the current schema (<source> instead of <coverage><include>).
  • CI matrix that matches the release: PHP 8.2, 8.3, 8.4 × Laravel 12 (plus your lowest supported Laravel if the constraint allows it). Pin orchestra/testbench to ^10.0 and phpunit/phpunit to ^11.0 so CI fails loudly on drift rather than silently resolving something unexpected.
  • Resolve dependency conflicts deliberately:
    composer why-not <vendor>/<package> ^4.0   # who's blocking the upgrade
    composer update <vendor>/<package> --with-all-dependencies
    

Gotchas and Tips

  • PHP 8.2 is a hard floor, and it moves through your whole stack. Base images (php:8.2-cli), platform.php in composer.json, CI runners, Laravel Forge/Envoyer/Vapor build images, and any shared-hosting PHP selector all need bumping. This is the single most common cause of "works locally, fails in CI" after this release.
  • PHPUnit 11 breaks docblock metadata. Expect @test, @dataProvider, and @covers annotations to be ignored or error. Grep for @test and @dataProvider before upgrading:
    grep -rn --include=*.php -E '@(test|dataProvider|depends|covers)\b' tests/
    
  • Testbench 10 changes the package test skeleton. If you maintain a package or a fork, the TestCase from v3-era Testbench is not the v10 one — regenerate it from the Testbench skeleton rather than patching.
  • Laravel 12's slim skeleton bites packages that assume the old layout. There is no app/Http/Kernel.php; middleware, exception handling, and scheduling live in bootstrap/app.php. If the package's install docs tell you to edit Kernel.php, those instructions are stale — translate them to ->withMiddleware() / ->withExceptions().
  • Publish with care. vendor:publish --force silently overwrites your edited config, and in a major bump the config file's shape may have changed. Diff the package's config/ against your published copy before re-publishing:
    diff vendor/<vendor>/<package>/config/<package>.php config/<package>.php
    
  • After any config publish or env change, clear caches. Stale config:cache / route:cache produces bugs that look like package regressions but aren't:
    php artisan optimize:clear
    
  • Pin the major and read the tag diff. ^4.0 is right for the constraint, but for the initial upgrade window a lock file plus a green test run matters more than the constraint. The release notes describe tooling, not API — so the risk is concentrated in transitive dependency resolution, which composer why-not surfaces immediately.
  • Extension points worth knowing: container bindings for the package's interfaces (the cleanest override), published config for behaviour, and its events/listeners for side effects. Reach for those before monkey-patching or extending concrete classes.
  • Debugging order when something misbehaves post-upgrade: (1) php artisan about for versions, (2) composer show <vendor>/<package> to confirm 4.x actually installed, (3) optimize:clear, (4) re-run the package's own test suite or a tinker smoke test to isolate package vs. your integration.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo