- 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.