ysato/catalyst
Composer 安装命令:
composer require ysato/catalyst
包简介
An Artisan command package for Laravel to improve code quality and project structure.
README 文档
README
A scaffolding tool to accelerate the setup of Laravel projects.
About This Package
This package generates the necessary file structure for initializing a Laravel project using a unified template system with enhanced extensibility.
Important Note: This command will always overwrite existing files.
To prevent unintended changes, you are expected to carefully review the output with a tool like git diff after running the command, and then selectively commit only the changes you want to adopt.
The tool's role is to generate a diff based on the latest template; how that diff is handled is delegated to the user.
Installation
Prerequisites (Strongly Recommended)
This package strongly recommends installing just, a command runner that simplifies Docker-based development workflows.
Please refer to the installation guide for your platform. For example, on macOS with Homebrew:
brew install just
Package Installation
Run the following command to install:
composer require --dev ysato/catalyst
Usage
This command will prompt you for necessary information interactively when run without arguments. For automation, you can pass the information as arguments to run it non-interactively.
Interactive Execution
If you run the command without any arguments, you will be prompted sequentially for the vendor name, package name, and PHP version.
php artisan catalyst:scaffold
Execution with Arguments (for Automation)
For use in CI/CD scripts, you can run the command non-interactively by passing arguments in the following format.
Format:
php artisan catalyst:scaffold <vendor> <package> <php>
| Argument | Description |
|---|---|
<vendor> |
(Required) The vendor name for namespacing (e.g., Ysato). |
<package> |
(Required) The package name that follows the vendor (e.g., Catalyst). |
<php> |
(Required) The PHP version to configure for the project (e.g., 8.3). |
Example:
php artisan catalyst:scaffold MyVendor MyProject 8.3
Options
| Option | Description |
|---|---|
--with-ca-file |
(Optional) Path to a custom CA certificate file to trust within the container. Needed when behind a corporate proxy. |
Example with Arguments and Options:
php artisan catalyst:scaffold MyCorp WebApp 8.3 --with-ca-file=./certs/certificate.pem
Post-Setup Manual Steps
Initial QA Setup
When running just composer lints for the first time on a newly scaffolded project, you may encounter errors due to existing code patterns. To resolve these, create baseline files for each QA tool:
PHP_CodeSniffer Baseline
vendor/bin/phpcs --report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml --basepath=.
PHPMD Baseline
vendor/bin/phpmd app,src text ./phpmd.xml --generate-baseline
PHPStan Baseline
vendor/bin/phpstan --generate-baseline
Add the generated baseline file to the includes in phpstan.neon:
includes: - vendor/larastan/larastan/extension.neon - vendor/nesbot/carbon/extension.neon + - phpstan-baseline.neon ...
Psalm Baseline
vendor/bin/psalm --set-baseline
Laravel IDE Helper Setup
For enhanced IDE support and autocompletion, run the Laravel IDE Helper commands:
php artisan ide-helper:generate php artisan ide-helper:models -N php artisan ide-helper:meta
OpenAPI Validation in Feature Tests
This package provides two types of OpenAPI validation capabilities for Feature tests:
Place your OpenAPI specification at the project root as openapi.yaml, or configure the path via OPENAPI_SPEC_PATH environment variable.
1. Request/Response Validation (ValidatesOpenApiSpec)
Automatically validates that requests called from test cases and returned responses comply with the OpenAPI specification.
2. Specification Coverage Verification (Spectatable)
Verifies whether the specifications described in the OpenAPI specification are being called from tests.
composer spectate
This displays a report showing which endpoints and status codes have been tested:
+-------------+--------+-------------------------------------------+-------------+
| IMPLEMENTED | METHOD | ENDPOINT | STATUS CODE |
+-------------+--------+-------------------------------------------+-------------+
| ✅ | GET | /threads | 200 |
| ✅ | POST | /threads | 201 |
| ✅ | POST | /threads | 422 |
| ✅ | POST | /threads | 401 |
| ✅ | GET | /threads/{threadid} | 200 |
| ✅ | GET | /threads/{threadid} | 404 |
| ❌ | PUT | /threads/{threadid} | 204 |
| ❌ | PUT | /threads/{threadid} | 401 |
| ❌ | PUT | /threads/{threadid} | 403 |
| ❌ | PUT | /threads/{threadid} | 404 |
| ❌ | PUT | /threads/{threadid} | 422 |
| ❌ | DELETE | /threads/{threadid} | 204 |
| ❌ | DELETE | /threads/{threadid} | 401 |
| ❌ | DELETE | /threads/{threadid} | 403 |
| ❌ | DELETE | /threads/{threadid} | 404 |
| ❌ | POST | /threads/{threadid}/scratches | 201 |
| ❌ | POST | /threads/{threadid}/scratches | 401 |
| ❌ | POST | /threads/{threadid}/scratches | 403 |
| ❌ | POST | /threads/{threadid}/scratches | 404 |
| ❌ | POST | /threads/{threadid}/scratches | 422 |
| ❌ | PUT | /threads/{threadid}/scratches/{scratchid} | 204 |
| ❌ | PUT | /threads/{threadid}/scratches/{scratchid} | 401 |
| ❌ | PUT | /threads/{threadid}/scratches/{scratchid} | 403 |
| ❌ | PUT | /threads/{threadid}/scratches/{scratchid} | 404 |
| ❌ | PUT | /threads/{threadid}/scratches/{scratchid} | 422 |
| ❌ | DELETE | /threads/{threadid}/scratches/{scratchid} | 204 |
| ❌ | DELETE | /threads/{threadid}/scratches/{scratchid} | 401 |
| ❌ | DELETE | /threads/{threadid}/scratches/{scratchid} | 403 |
| ❌ | DELETE | /threads/{threadid}/scratches/{scratchid} | 404 |
+-------------+--------+-------------------------------------------+-------------+
Importing GitHub Rulesets
This project generates predefined GitHub rulesets as JSON files in the .github/rulesets directory. These must be manually applied to your repository.
Prerequisites
- You need admin access to the GitHub repository where you want to import these rulesets.
Importing via GitHub UI
-
Navigate to your repository on GitHub.
-
Click on Settings.
-
In the left sidebar, under the "Code and automation" section, click on Rules, then Rulesets.
-
Click the "Import ruleset" button.
-
When prompted to upload a JSON file, select a
.jsonfile from the.github/rulesets/directory. -
Review the imported settings and click "Create".
-
Repeat for other ruleset files as needed.
Note: Carefully review the "Target branches" section for each ruleset after import to ensure they apply to the intended branches (e.g.,
main,develop).
Documentation
Detailed documentation is available on the GitHub wiki.
For Contributors
Development Setup
This project uses Docker for development. Use the provided justfile commands.
Available Commands
just build- Builds the necessary Docker imagesjust composer- Runs composer commands via Dockerjust act- Runs GitHub Actions locallyjust clean- Removes the Docker imagesjust help- Displays this help message
Compatibility Testing
To install the oldest compatible versions of dependencies and ensure this package works reliably in diverse environments, run the following command:
composer update --prefer-lowest
License
This package is provided under the MIT License.
ysato/catalyst 适用场景与选型建议
ysato/catalyst 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 370 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 06 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「qa」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ysato/catalyst 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ysato/catalyst 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ysato/catalyst 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
Turn any PDF into a Pingen-ready A4 letter (generated address cover page + A4 normalisation + safe margins) and send it through the Pingen print & mail API. Laravel-first.
统计信息
- 总下载量: 370
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-02