定制 redberryproducts/laravel-packager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

redberryproducts/laravel-packager

最新稳定版本:v1.0.2

Composer 安装命令:

composer require redberryproducts/laravel-packager

包简介

Package to easily initiate new package using spatie's laravel package skeleton

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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:

  1. Create a package skeleton github repository
  2. Add new entry to skeletons list inside the published config
  3. 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.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-11