定制 saineshmamgain/laravel-setup-helper 二次开发

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

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

saineshmamgain/laravel-setup-helper

Composer 安装命令:

composer require saineshmamgain/laravel-setup-helper

包简介

A package to setup basic functionality to a new laravel installation

README 文档

README

A package to add some extra goodies to your laravel applications.

Setup

Install

composer require saineshmamgain/laravel-setup-helper

Publish the config

php artisan vendor:publish --tag=setup-helper-config

The config has following switches:

override_request_make_command

override_make_job_command

Set to false if you don't want these functionalities.

Run

php artisan setup-helper:install

Run with --force tag to replace previously generated files.

Create a trait

php artisan make:trait FooTrait

Create a contract (interface)

php artisan make:contract FooContract

Create a Request Class

Can be controlled from config

php artisan make:request FooRequest

The request class created by this package extends a BaseRequest class which in turn extends the original FormRequest class.

In this class by default authorize() method returns true.

While writing Form Requests in Laravel, we have to create a class and define rules in it.

for example if you want to write validations for creating a user you will create a UserRequest class

now for editing the user either you will create an EditUserRequest class and define the rules, or you will use the UserRequest class and will write conditions for applying some rules only when it is an edit request.

To make this more smooth this package Provides BaseRequest class.

When installation is complete, the request files created by php artisan make:request command will extend this BaseRequest class.

getMethodRules() To apply rules only on GET requests

postMethodRules() To apply rules only on POST requests

putMethodRules() To apply rules only on PUT requests

patchMethodRules() To apply rules only on PATH requests

deleteMethodRules() To apply rules only on DELETE requests

Contribution

PRs are welcome.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固