florianpalabost/lara-stubs 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

florianpalabost/lara-stubs

最新稳定版本:v0.1.0

Composer 安装命令:

composer require florianpalabost/lara-stubs

包简介

Opinionated Laravel stubs with strict types, final classes, and modern PHP conventions

README 文档

README

Opinionated Laravel stubs with strict types, final classes, and modern PHP conventions.

Features

  • Strict Types: All PHP files include declare(strict_types=1)
  • Final Classes: Uses final keyword for better immutability and intentional inheritance
  • Modern Conventions: Follows current PHP and Laravel best practices
  • Custom Stubs: Includes Action and Data stubs for common patterns
  • Pest Integration: Test stubs use it() syntax

Installation

Install via Composer:

composer require florianpalabost/lara-stubs --dev

Publish the stubs to your project:

php artisan vendor:publish --tag=lara-stubs

This will copy all stubs to your project's stubs/ directory, where Laravel will automatically use them.

Available Stubs

Custom Stubs

  • action.stub - Action pattern class with strict types and final modifier
  • data.stub - Spatie Laravel Data class

Enhanced Laravel Stubs

All standard Laravel stubs with improvements:

  • Controllers (API, invokable, nested, singleton variants)
  • Models, migrations, factories, seeders
  • Jobs, listeners, events
  • Policies, observers
  • Requests, resources, rules
  • Tests (Pest with it() syntax)
  • And more...

Usage

After publishing, all php artisan make:* commands will use these stubs:

# Creates an Action with strict types and final modifier
php artisan make:class CreateUserAction

# Creates a Data class extending Spatie\LaravelData\Data
php artisan make:class UserData

# Creates a controller with enhanced stub
php artisan make:controller UserController

# Creates a Pest test using it() syntax
php artisan make:test UserTest

Customization

After publishing, you can customize the stubs in your stubs/ directory. Your changes will be used instead of Laravel's defaults.

Requirements

  • PHP 8.2 or higher
  • Laravel 11.x or 12.x

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固