定制 rawilk/laravel-stubs 二次开发

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

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

rawilk/laravel-stubs

最新稳定版本:v2.0.0

Composer 安装命令:

composer require rawilk/laravel-stubs

包简介

Opinionated modifications to the default Laravel stubs.

README 文档

README

Latest Version on Packagist Tests Total Downloads PHP from Packagist License

Social image

This repo contains opinionated versions of the Laravel stubs. The most notable changes are:

  • migrations don't have a down function
  • controllers don't extend a base controller
  • none of the model attributes are guarded
  • use return type hints where possible
  • most docblocks have been removed
  • declare(strict_types=1); added to most files

Installation

You can install the package via composer:

composer require rawilk/laravel-stubs --dev

If you want to keep your stubs up-to-date with every update, add this composer hook to your composer.json file:

"scripts": {
    "post-update-cmd": [
        "@php artisan custom-stub:publish --force"
    ]
}

Usage

You can publish the stubs using this command:

php artisan custom-stub:publish

Usage in Packages

If you're developing a package, you may pull these stubs in to your package and generate them just like you would with a normal Laravel project. This is possible when used with Orchestral Canvas. On your package project, run the following command:

composer require --dev rawilk/laravel-stubs orchestra/canvas

Next you need to run:

composer exec canvas preset package

Finally, modify the generated canvas.yaml file:

preset: Rawilk\Stubs\Canvas\Package
namespace: YourPackageNamespace

To generate a file, you can run the following command:

composer exec canvas make:migration CreatePostsTable --create

Running this would generate a migration normally, just like the php artisan make:migration command would. For more information on canvas, please refer to their documentation.

Tip: Create an alias for composer exec canvas in your profile to allow easier entering of your generator commands. I personally added the following alias to my bash profile:

alias canvas="composer exec canvas"

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固