PHPackages                             yangweijie/thinkphp-package-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yangweijie/thinkphp-package-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yangweijie/thinkphp-package-tools
=================================

thinkphp 扩展包开发工具

v1.0.8(1y ago)00MITPHPPHP ^8.1

Since May 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/yangweijie/thinkphp-package-tools)[ Packagist](https://packagist.org/packages/yangweijie/thinkphp-package-tools)[ Docs](https://github.com/yangweijie/thinkphp-package-tools)[ RSS](/packages/yangweijie-thinkphp-package-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (9)Versions (10)Used By (0)

thinkphp-package-tools
======================

[](#thinkphp-package-tools)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance49

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

9

Last Release

378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0b5f090a9bb92727e9c2e8281d05c2da5f2f9bf66cf1811714a9ffc0e383325?d=identicon)[yangweijie](/maintainers/yangweijie)

---

Top Contributors

[![yangweijie](https://avatars.githubusercontent.com/u/1614114?v=4)](https://github.com/yangweijie "yangweijie (17 commits)")

---

Tags

thinkphpyangweijiethinkphp-package-tools

### Embed Badge

![Health badge](/badges/yangweijie-thinkphp-package-tools/health.svg)

```
[![Health](https://phpackages.com/badges/yangweijie-thinkphp-package-tools/health.svg)](https://phpackages.com/packages/yangweijie-thinkphp-package-tools)
```

###  Alternatives

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
