承接 yangweijie/thinkphp-package-tools 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

yangweijie/thinkphp-package-tools

最新稳定版本:v1.0.8

Composer 安装命令:

composer require yangweijie/thinkphp-package-tools

包简介

thinkphp 扩展包开发工具

README 文档

README

参考laravel-package-tools 实现的开发ThinkPHP扩展的包

This package contains a PackageService that you can use in your packages to easily register config files, migrations, and more.

Here's an example of how it can be used.

use Spatie\LaravelPackageTools\PackageServiceProvider;
use Spatie\LaravelPackageTools\Package;
use MyPackage\ViewComponents\Alert;
use Spatie\LaravelPackageTools\Commands\Concerns;

class YourPackageServiceProvider extends PackageServiceProvider
{
    public function configurePackage(Package $package): void
    {
        $package
            ->name('your-package-name')
            ->hasConfigFile()
            ->hasViews()
            ->hasViewComponent('spatie', Alert::class)  // 仅laravel 迁移过来的扩展
            ->hasViewComposer('*', MyViewComposer::class) // 仅laravel 迁移过来的扩展
            ->sharesDataWithAllViews('downloads', 3)   // 仅laravel 迁移过来的扩展
            ->hasTranslations()      // 仅laravel 迁移过来的扩展
            ->hasAssets()
            ->publishesServiceProvider('MyProviderName')
            ->hasRoute('web')
            ->hasMigration('create_package_tables')
            ->hasCommand(YourCoolPackageCommand::class)             // 无需在 composer.json 中注册命令
            ->hasInstallCommand(function(InstallCommand $command) {   // 添加独立的安装命令
                $command
                    ->publishConfigFile()
                    ->publishAssets()
                    ->publishMigrations()
                    ->copyAndRegisterServiceProviderInApp()
                    ->askToStarRepoOnGitHub();
            });
    }
}

Under the hood it will do the necessary work to register the necessary things and make all sorts of files publishable.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固