redberryproducts / laravel-packager
Package to easily initiate new package using spatie's laravel package skeleton
Fund package maintenance!
Redberry
Requires
- php: ^8.3|^8.4
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-04-16 08:47:59 UTC
README
Laravel Packager is a streamlined Laravel package designed to simplify the creation of new package skeletons within your project. With minimal effort, it clones a customizable skeleton repository, detaches it from its original Git history, and seamlessly integrates the new package into your application’s composer.json. By automating these steps, Laravel Packager eliminates the friction of package initialization, making it effortless to extract reusable features into standalone packages for enhanced modularity and maintainability.
Installation
You can install the package via composer:
composer require redberryproducts/laravel-packager
You can publish the config file with:
php artisan vendor:publish --tag="packager-config"
This is the contents of the published config file:
return [ 'default_skeleton' => 'spatie', 'skeletons' => [ 'spatie' => [ 'url' => 'https://github.com/spatie/package-skeleton-laravel.git', 'branch' => 'main', 'runs' => [ 'php configure.php', ], ], ], 'packages_directory' => 'packages', ];
If you want to add another skeleton, or create your custom skeleton and give package ability to initilize this inside your project, you will need to do the following:
- Create a package skeleton github repository
- Add new entry to skeletons list inside the published config
- Modify default_skeletons to reflect new skeleton name
Usage
php artisan make:package vendor-name/package-name
For example:
php artisan make:package acme/example
This command: Clones the Spatie skeleton (or your configured skeleton) to packages/acme/example.
Initializes a new Git repository, detaching it from the skeleton’s history.
Updates composer.json to include:
{ "repositories": [ { "type": "path", "url": "./packages/acme/example", "options": { "symlink": true } } ], "require-dev": { "acme/example": "*" } }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.