定制 simaocurado/laravel-extra 二次开发

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

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

simaocurado/laravel-extra

Composer 安装命令:

composer require simaocurado/laravel-extra

包简介

Opinionated Laravel defaults for action-oriented architecture, strict typing, code quality, and team consistency.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

axiom is an opinionated package for Laravel projects that want stronger defaults from day one. It works best on freshly created Laravel projects, where conventions can be applied early with minimal friction.

It brings the same direction used in my starter kits into an existing Laravel app: actions, DTOs, enums, stricter quality tooling, AI guidelines, and a more disciplined baseline for code generation and project setup.

Current target support: Laravel 11, 12, and 13.

What It Brings

  • Action-oriented architecture
  • DTO-first boundaries
  • Final and readonly by default
  • CRUD-oriented generators
  • AI guidelines and modular AI skills
  • Strict Laravel defaults
  • Real quality presets for PHPStan, Rector, Pint, and Arch tests
  • Optional project scripts and dependency presets

Installation

Install the package:

composer require simaocurado/axiom

Run the installer:

php artisan axiom:install

You can also run it non-interactively:

php artisan axiom:install \
  --ai=boost \
  --skills \
  --auth-routes=app \
  --install-auth \
  --ssr \
  --actions \
  --quality \
  --strict \
  --scripts \
  --phpstan \
  --rector \
  --pint \
  --type-coverage \
  --debug-tool=debugbar \
  --oxlint \
  --prettier \
  --concurrently \
  --ncu

Installer Options

The installer can:

  • publish AGENTS.md or CLAUDE.md
  • publish .ai/skills/*.md
  • if auth scaffold already exists in the starter kit, leave auth untouched
  • when no auth scaffold exists, ask whether auth scaffold should be installed
  • support non-interactive auth scaffold installation with --install-auth
  • when Fortify is installed, ask whether auth should use Fortify-managed routes or app-managed routes
  • when auth scaffold is installed in app-managed mode, publish the React/Vue starter-kit backend auth stubs, routes, and matching Inertia auth pages without duplicating existing settings pages or adding frontend auth dependencies
  • when Fortify-managed mode is selected, leave existing Fortify files untouched
  • ask whether the project should use SSR and wire that into composer dev
  • create app/Actions, app/Dto, and app/Enums
  • publish phpstan.neon, rector.php, pint.json, and tests/Unit/ArchTest.php
  • publish a host App\Providers\AxiomServiceProvider
  • register that provider in bootstrap/providers.php when available
  • add opinionated composer scripts
  • add optional PHP tooling dependencies like PHPStan, Rector, Pint, Pest type coverage, Debugbar, and Telescope
  • add optional frontend tooling dependencies like Oxlint, Prettier, concurrently, and npm-check-updates

Generated Structure

When you enable architecture-related options, the installer prepares the host project with:

  • app/Actions
  • app/Dto
  • app/Enums
  • .ai/architecture.md
  • .ai/quality.md
  • .ai/skills/actions.md
  • .ai/skills/dto.md
  • .ai/skills/enum.md
  • .ai/skills/crud.md
  • .ai/skills/quality.md

Commands

  • php artisan axiom:install
  • php artisan make:action Name
  • php artisan make:dto Name
  • php artisan make:enum Name
  • php artisan make:request Name
  • php artisan make:crud-action Model --operation=create Creates a CRUD-oriented action for a model workflow.

Composer Scripts

  • composer setup Prepares the project for local development.
  • composer dev Starts the local development workflow.
  • composer lint Runs auto-fix quality tools like Rector and Pint.
  • composer fix:rector Applies Rector refactors.
  • composer test Runs the full project quality and test suite.
  • composer test:type-coverage Runs Pest type coverage.
  • composer test:unit Runs the test suite.
  • composer test:lint Runs lint checks without changing files.
  • composer test:rector Runs Rector in dry-run mode.
  • composer test:types Runs static analysis.
  • composer update:requirements Updates project dependency constraints.
  • composer configure:app-url Sets the local APP_URL based on the project directory name.

Quality Presets

When enabled, Axiom can publish:

  • phpstan.neon
  • rector.php
  • pint.json
  • tests/Unit/ArchTest.php

And it can prepare the host project with optional dependencies for:

  • Larastan
  • PHPStan
  • Rector
  • Pint
  • Pest type coverage
  • Oxlint
  • Prettier
  • frontend quality scripts

Published composer scripts include dedicated Rector commands:

  • composer fix:rector
  • composer test:rector

Strict Defaults

When strict defaults are enabled, the published host provider configures:

  • immutable dates with CarbonImmutable
  • Model::shouldBeStrict(...)
  • Model::automaticallyEagerLoadRelationships()

AI Guidelines And Skills

Axiom separates global guidance from task-focused workflows:

  • guidelines: AGENTS.md / CLAUDE.md
  • skills: .ai/skills/*.md

This makes it easier to keep project rules stable while still giving AI tools focused instructions for actions, DTOs, enums, CRUD, and quality work.

Current Scope

This package is especially useful for fresh Laravel projects or projects that are still early enough to adopt stronger conventions without a painful migration.

It is not trying to replace Laravel. It is trying to make a Laravel app feel closer to my preferred defaults:

  • reusable actions
  • explicit DTOs
  • thin controllers
  • strict static analysis
  • fail-fast feedback
  • cleaner code generation

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

simaocurado/laravel-extra 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

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