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
package-service-provider
wendelladriel/laravel-expressive
claude-code
service-providers
package-development
config-merge
publishing
console-commands
testing

Use this skill when changing a Laravel package service provider: config merges, routes, views, translations, publishing, migrations, assets, Blade components, commands, console-only behavior, or package metadata.

Install
php artisan boost:add-skill wendelladriel/laravel-expressive

Save this content to: .claude/skills/package-service-provider/SKILL.md

# Package Service Provider

## Primary Goal

Wire package capabilities through explicit Laravel service provider code without defaulting to `spatie/laravel-package-tools`.

## Workflow

1. Inspect the package service provider and keep its existing method split. If the package uses names like `registerResources`, `registerPublishing`, `registerBladeComponents`, `registerConsole`, or `registerAboutMetadata`, add new behavior to the matching concern.
2. Put container bindings and `mergeConfigFrom` calls in `register()` when the host app must be able to override configuration.
3. Put resource loading in boot-time methods with Laravel-native APIs such as `loadRoutesFrom`, `loadViewsFrom`, and `loadTranslationsFrom`.
4. Guard console-only publishing and command registration with `runningInConsole()` before calling `publishes`, `publishesMigrations`, or `commands`.
5. Add tests for the observable package behavior: merged config, loaded routes, publish tags, command registration, or about metadata.

## References

- `src/*ServiceProvider.php`
- `config/*.php`
- `routes/*.php`
- `resources/views/`
- `lang/`
- `database/migrations/`
- `src/Console/Commands/`

## Examples

- Wire a new publish tag by adding a `publishes` map inside the existing console-guarded publishing method and naming the tag with `expressive-*`.
- Add a command by creating the command class, importing it in the provider, and adding it to the `commands` array inside the `runningInConsole()` guard.

## Anti-Patterns

- Loading host app state too early during provider registration.
- Calling `env()` outside config files; avoid `env() outside config` by using config values after `mergeConfigFrom` instead.
- Registering web-only concerns unconditionally when the package can run in console contexts.
- Replacing explicit provider methods with `spatie/laravel-package-tools` by default.

Package Service Provider

Primary Goal

Wire package capabilities through explicit Laravel service provider code without defaulting to spatie/laravel-package-tools.

Workflow

  1. Inspect the package service provider and keep its existing method split. If the package uses names like registerResources, registerPublishing, registerBladeComponents, registerConsole, or registerAboutMetadata, add new behavior to the matching concern.
  2. Put container bindings and mergeConfigFrom calls in register() when the host app must be able to override configuration.
  3. Put resource loading in boot-time methods with Laravel-native APIs such as loadRoutesFrom, loadViewsFrom, and loadTranslationsFrom.
  4. Guard console-only publishing and command registration with runningInConsole() before calling publishes, publishesMigrations, or commands.
  5. Add tests for the observable package behavior: merged config, loaded routes, publish tags, command registration, or about metadata.

References

  • src/*ServiceProvider.php
  • config/*.php
  • routes/*.php
  • resources/views/
  • lang/
  • database/migrations/
  • src/Console/Commands/

Examples

  • Wire a new publish tag by adding a publishes map inside the existing console-guarded publishing method and naming the tag with expressive-*.
  • Add a command by creating the command class, importing it in the provider, and adding it to the commands array inside the runningInConsole() guard.

Anti-Patterns

  • Loading host app state too early during provider registration.
  • Calling env() outside config files; avoid env() outside config by using config values after mergeConfigFrom instead.
  • Registering web-only concerns unconditionally when the package can run in console contexts.
  • Replacing explicit provider methods with spatie/laravel-package-tools by default.
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.
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support