定制 zairakai/laravel-dev-tools 二次开发

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

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

zairakai/laravel-dev-tools

Composer 安装命令:

composer require zairakai/laravel-dev-tools

包简介

The unified and centralized development toolkit for Laravel projects - Pint, PHPStan, Rector, PHP Insights, git hooks, and GitLab CI pipeline templates

README 文档

README

Main Coverage

GitLab Release Packagist Downloads License

PHP Laravel Static Analysis Code Style

One unified toolkit to set up Laravel quality tooling. Context-aware by default — it adapts to both standalone packages and full-stack applications.

Why zairakai/laravel-dev-tools?

ConceptBenefit
Unified LogicThe same quality gate for all your projects. Only the target (package or app) changes, not the rigor.
Concentrated ConfigsCentralized, opinionated configurations for PHPStan, Rector, Pint, and PHP Insights. Avoid configuration drift across projects.
Unified WorkflowOne set of make commands to rule them all. Whether it's a small package or a full-stack app, the quality gate remains the same.
Auto-Syncing CIAutomatically updates GitLab CI ref tags in your .gitlab-ci.yml when you update the package. Keep your pipelines current without manual effort.
Zero FrictionAutomated setup via composer plugin and shell scripts handles the heavy lifting on install.

Features

ToolResponsibility
PintOpinionated Laravel code style enforcer.
PHPStanStatic analysis at max level with Laravel-aware rules.
RectorAutomated refactoring and modernization.
PHP InsightsArchitecture and code quality metrics.
PHPMetricsCode metrics report.
MarkdownlintConsistent documentation.
ShellCheckValidated shell scripts.
GitLab CIReusable pipeline templates for Laravel apps and packages.
MakefileUnified make quality, make test, make ci targets (delegated to core).
Full-stackIntegrates with @zairakai/js-dev-tools for JS/TS tooling in one unified workflow.

On install, the composer plugin:

  • creates Makefile (PHP-only or full-stack if package.json is detected, delegating to vendor/zairakai/laravel-dev-tools/tools/make/core.mk)
  • creates .editorconfig
  • creates config/dev-tools/baseline.neon for PHPStan
  • adds necessary scripts to composer.json
  • registers the automatic GitLab CI ref synchronization

Install

composer require --dev zairakai/laravel-dev-tools

For full-stack Laravel + Vue projects:

composer require --dev zairakai/laravel-dev-tools
npm install --save-dev @zairakai/js-dev-tools
php artisan dev-tools:publish --fullstack

Usage

make quality        # pint + phpstan + rector + insights + markdownlint + shellcheck
make quality-fast   # pint + phpstan + markdownlint (fast CI check)
make quality-fix    # auto-fix (rector + pint + markdownlint)
make test           # phpunit
make test-coverage  # phpunit with coverage report (requires PCOV or Xdebug)
make test-all       # phpunit + bats
make ci             # full pipeline simulation
make doctor         # environment diagnostics

Configuration

The package provides a set of opinionated configurations that you can use as-is or extend in your project.

PHPStan

Create phpstan.neon in your project root:

includes:
    - vendor/zairakai/laravel-dev-tools/config/base.neon

parameters:
    paths:
        - src
        - tests

Rector

Create rector.php in your project root:

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void
{
    $rectorConfig->import(__DIR__ . '/vendor/zairakai/laravel-dev-tools/config/rector.base.php');

    $rectorConfig->paths([
        __DIR__ . '/src',
        __DIR__ . '/tests',
    ]);
};

PHP Insights

Create insights.php in your project root:

<?php

declare(strict_types=1);

return require 'vendor/zairakai/laravel-dev-tools/config/insights.base.php';

Publishing configs

Publish config files to config/dev-tools/ (never overwritten unless --force):

# All at once
php artisan dev-tools:publish --publish

# By group
php artisan dev-tools:publish --publish=quality
php artisan dev-tools:publish --publish=style
php artisan dev-tools:publish --publish=testing
php artisan dev-tools:publish --publish=hooks

# Single files
php artisan dev-tools:publish --publish=phpstan
php artisan dev-tools:publish --publish=baseline
php artisan dev-tools:publish --publish=rector
php artisan dev-tools:publish --publish=insights
php artisan dev-tools:publish --publish=pint
php artisan dev-tools:publish --publish=markdownlint
php artisan dev-tools:publish --publish=phpunit
php artisan dev-tools:publish --publish=gitlab-ci

# Full-stack Makefile (PHP + JS)
php artisan dev-tools:publish --fullstack

For standalone packages (without artisan):

bash vendor/zairakai/laravel-dev-tools/scripts/setup-package.sh --publish=gitlab-ci
bash vendor/zairakai/laravel-dev-tools/scripts/setup-package.sh --fullstack

GitLab CI pipeline templates

# Laravel package pipeline
include:
  - project: 'zairakai/php-packages/laravel-dev-tools'
    ref: v1.0.0          # pin to a release tag for reproducible builds
    file: '.gitlab/ci/pipeline-php-package.yml'

variables:
  CACHE_KEY: "my-package-v1"
  PACKAGIST_PACKAGE: "vendor/my-package"
# Laravel application pipeline
include:
  - project: 'zairakai/php-packages/laravel-dev-tools'
    ref: v1.0.0          # pin to a release tag for reproducible builds
    file: '.gitlab/ci/pipeline-laravel-app.yml'

variables:
  CACHE_KEY: "my-app-v1"
# Laravel + Vue full-stack pipeline (PHP + JS in one include)
include:
  - project: 'zairakai/php-packages/laravel-dev-tools'
    ref: v1.0.0          # pin to a release tag for reproducible builds
    file: '.gitlab/ci/pipeline-laravel-fullstack.yml'

variables:
  CACHE_KEY: "my-app-v1"

Available templates:

  • pipeline-php-package.yml — security → install → validate → quality → test → publish → release
  • pipeline-laravel-app.yml — security → install → validate → quality → test → deploy → metrics
  • pipeline-laravel-fullstack.yml — aggregates PHP + JS pipelines via a single include

Development

make quality        # full quality check
make quality-fast   # fast check (pint + phpstan + markdownlint)
make test           # run tests
make doctor         # environment diagnostics

Contributing

Contributions are welcome. Please read CONTRIBUTING.md for the project-specific workflow and quality standards.

Getting Help

License Security Policy Issues

Made with ❤️ by Zairakai

zairakai/laravel-dev-tools 适用场景与选型建议

zairakai/laravel-dev-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 132 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「toolkit」 「laravel」 「dev-tools」 「gitlab-ci」 「unified」 「centralized」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 zairakai/laravel-dev-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 zairakai/laravel-dev-tools 我们能提供哪些服务?
定制开发 / 二次开发

基于 zairakai/laravel-dev-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-11