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
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?
| Concept | Benefit |
|---|---|
| Unified Logic | The same quality gate for all your projects. Only the target (package or app) changes, not the rigor. |
| Concentrated Configs | Centralized, opinionated configurations for PHPStan, Rector, Pint, and PHP Insights. Avoid configuration drift across projects. |
| Unified Workflow | One 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 CI | Automatically updates GitLab CI ref tags in your .gitlab-ci.yml when you update the package. Keep your pipelines current without manual effort. |
| Zero Friction | Automated setup via composer plugin and shell scripts handles the heavy lifting on install. |
Features
| Tool | Responsibility |
|---|---|
| Pint | Opinionated Laravel code style enforcer. |
| PHPStan | Static analysis at max level with Laravel-aware rules. |
| Rector | Automated refactoring and modernization. |
| PHP Insights | Architecture and code quality metrics. |
| PHPMetrics | Code metrics report. |
| Markdownlint | Consistent documentation. |
| ShellCheck | Validated shell scripts. |
| GitLab CI | Reusable pipeline templates for Laravel apps and packages. |
| Makefile | Unified make quality, make test, make ci targets (delegated to core). |
| Full-stack | Integrates 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 ifpackage.jsonis detected, delegating tovendor/zairakai/laravel-dev-tools/tools/make/core.mk) - creates
.editorconfig - creates
config/dev-tools/baseline.neonfor 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 → releasepipeline-laravel-app.yml— security → install → validate → quality → test → deploy → metricspipeline-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
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zairakai/laravel-dev-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel dev-tools
Enable https on Laravel sail powered apps.
Symfony2 Bundle that adds basic user account entity and city/state/country setup as well
Symfony bundle for anonymizing database records using Doctrine attributes and Faker generators. Perfect for test data generation, GDPR compliance, and data masking in development environments.
Interactive Laravel project setup command with best practices, testing tools, and CI/CD workflows
Common helpers and classes for ICanBoogie
统计信息
- 总下载量: 132
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 38
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-11