Weave Code
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 Package Toolkit

Laravel Package Toolkit Laravel Package

nyoncode/laravel-package-toolkit

Toolkit for building Laravel packages with less boilerplate: configure routes, migrations, translations, views/components, middleware, assets and commands. Includes install/about commands, publishing options, lifecycle hooks, and package-specific exception handling.

View on GitHub
Deep Wiki
Context7

Laravel Package Builder is a powerful tool designed to streamline the process of creating and managing packages for Laravel.

Frequently asked questions about Laravel Package Toolkit
How do I install and set up nyoncode/laravel-package-toolkit in a Laravel project?
Run `composer require nyoncode/laravel-package-toolkit` to install. Extend `PackageServiceProvider` in your package’s provider and implement the `Packable` contract for full toolkit features. Follow the [Basic Configuration](#basic-configuration) section in the README for step-by-step setup.
Does this package support Laravel 11 or 12? Are there breaking changes from Laravel 10?
Yes, it fully supports Laravel 10–13. Version 2.1.1 includes fixes for silent failures in `vendor:publish` (e.g., assets, translations) and view components, ensuring compatibility. No Laravel-specific breaking changes exist, but PHP 8.1+ is required.
How do I publish package assets, translations, or views using this toolkit?
Use `hasAssets()`, `hasTranslations()`, and `hasViews()` in your `Packable` provider. Run `php artisan vendor:publish --tag=assets` (or `--tag=views`, `--tag=translations`) after installation. Version 2.1.1 fixes critical bugs where these tags previously failed silently.
What’s the difference between `bootViewComposers()` and `bootViewComposers()` (deprecated) in 2.1.1?
The old `bootVewComposers()` (with a typo) was deprecated and renamed to `bootViewComposers()` in 2.1.1. Update your provider if you used the deprecated method. The new method correctly registers view composers without numeric aliases or duplicates.
Can I customize the install command’s tag separator or handle relative paths in views?
Yes, the `$tagSeparator` is now configurable in the install command. For relative paths in `hasViews()`, the toolkit resolves them automatically, reducing manual overrides. Check the [Install Command](#install-command) and [Views](#views) sections for details.
How do I handle package-specific exceptions or lifecycle hooks in this toolkit?
Use the built-in exception handling via `throw new PackageException()` for package-specific errors. Lifecycle hooks like `booting()`, `booted()`, and `register()` are supported in the `PackageServiceProvider` base class. See [Lifecycle Hooks](#lifecycle-hooks) for examples.
Does this package work with view components? How do I register them?
Yes, it fully supports Laravel view components. Register them in your `Packable` provider using `bootViewComponents()`. Version 2.1.1 fixes issues with numeric aliases and duplicate registrations. Follow the [View Components](#view-components) guide for setup.
What alternatives exist if I need more advanced asset or translation publishing?
For advanced asset/translation publishing, consider `spatie/laravel-package-tools`, which handles edge cases like region-specific locales (e.g., `pt_BR`). This toolkit focuses on reducing boilerplate for core package features like routes, migrations, and commands.
How do I upgrade from v1.x to v2.x? Are there breaking changes?
Review the [Upgrading from v1.x](#upgrading-from-v1x) section. Key changes include the `Packable` contract hierarchy, renamed `bootVewComposers()` to `bootViewComposers()`, and fixes for `hasAssets()`/`hasTranslations()`. Test thoroughly, especially if using deprecated methods like `HasAbout`.
Will this toolkit slow down my Laravel application in production?
No, the performance overhead is minimal. PHPStan integration adds ~5–10ms to `composer lint`, and view component fixes may increase boot time by ~1–2ms. The toolkit is optimized for production use with no significant runtime impact.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky