zero-to-prod/package-helper
Laravel package that helps you scaffold and manage reusable PHP/Laravel packages faster. Provides handy helpers and sensible defaults to streamline setup, development workflows, and publishing assets/config so you can go from zero to production quickly.
Start by installing the package via Composer into your package’s development dependencies:
composer require --dev zero-to-prod/package-helper
Then, in your package’s main service provider (e.g., YourPackageServiceProvider), extend the provided base class instead of ServiceProvider:
use ZeroToProdPackageHelper\ServiceProvider;
class YourPackageServiceProvider extends ServiceProvider
{
protected $configPath = __DIR__.'/../config/your-package.php';
protected $migrationsPath = __DIR__.'/../database/migrations';
protected $viewsPath = __DIR__.'/../resources/views';
}
The first use case is simple: scaffolding a new package with zero boilerplate—just extend the class, define paths, and publish() calls for config/migrations/views happen automatically on php artisan vendor:publish.
$this->publishesConfig(), $this->publishesMigrations(), and $this->publishesViews() in boot()—no repetitive publishes() arrays needed.$this->registerCommands([YourCommand::class]) to register multiple Artisan commands cleanly.configureEnvironment() to apply defaults (e.g., fallback config values) conditionally per environment.laravel-packager or custom scripts to generate boilerplate via vendor:publish --tag=your-package-config.publishesConfig() throws a runtime error if the config file doesn’t exist—ensure it’s present before first publish (e.g., include a stub in config/your-package.php).publishesMigrations() in multiple service providers (e.g., core + optional features).register() / boot() after calling parent::register() / parent::boot(). The base class handles resource registration in the correct order.$this->publishes*() without vendor:publish—by design, nothing is auto-registered to config/app.php unless explicitly requested. Users must explicitly publish to customize.app()->runningInConsole(): If you need command-specific logic in your provider, guard it with if ($this->app->runningInConsole()) { ... }—though most helpers already do this internally.How can I help you explore Laravel packages today?