Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php
dcat-x/laravel-admin
cursor
admin
form
crud
grid
laravel
dashboard
rbac

PHP/Laravel 代码规范,编辑 src/ 或 tests/ 下的 PHP 文件时适用

Install
php artisan boost:add-skill dcat-x/laravel-admin

Save this content to: .cursor/rules/php.md

# PHP 规范

- 全局启用 `declare(strict_types=1)`,禁止传 `null`/`mixed` 给 string 参数,必要时用 `(string)` 转换
- 代码风格: Pint preset `laravel`,修改后运行 `composer pint`
- 类型安全: Rector (`NullToStrictStringFuncCallArgRector`),新代码不得引入新的 Rector 错误
- 静态分析: PHPStan level 5,新代码不得引入新的 PHPStan 错误
- Namespace: `Dcat\Admin\*`,tests 使用 `Dcat\Admin\Tests\*`
- 断言统一使用 `assertSame`(严格相等),不用 `assertEquals`
- 闭包回调优先重构为具名 protected 方法,提升可测试性
- 避免 `call_user_func`,直接调用方法
- Trait 方法调用前用 `method_exists` 检查兼容性
- 测试基类: `Dcat\Admin\Tests\TestCase`(extends Orchestra Testbench)

PHP 规范

  • 全局启用 declare(strict_types=1),禁止传 null/mixed 给 string 参数,必要时用 (string) 转换
  • 代码风格: Pint preset laravel,修改后运行 composer pint
  • 类型安全: Rector (NullToStrictStringFuncCallArgRector),新代码不得引入新的 Rector 错误
  • 静态分析: PHPStan level 5,新代码不得引入新的 PHPStan 错误
  • Namespace: Dcat\Admin\*,tests 使用 Dcat\Admin\Tests\*
  • 断言统一使用 assertSame(严格相等),不用 assertEquals
  • 闭包回调优先重构为具名 protected 方法,提升可测试性
  • 避免 call_user_func,直接调用方法
  • Trait 方法调用前用 method_exists 检查兼容性
  • 测试基类: Dcat\Admin\Tests\TestCase(extends Orchestra Testbench)
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings