定制 owowagency/remove-required-rules 二次开发

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

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

owowagency/remove-required-rules

Composer 安装命令:

composer require owowagency/remove-required-rules

包简介

Small helper function which lets you remove the required rule from your validation rules

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions

Sometimes you'd like to reuse all rules from the store request in an update request, but without the required rules. This helper methods does that for you. It loops through all the rules and tries to remove the required rule for you.

Installation

You can install the package via composer:

composer require owowagency/remove-required-rules

Usage

$rules = remove_required($rules);

What this would look like in a form request

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        // Input: 'required|string' or ['required', 'string']
        $rules = (new StoreRequest())->rules();

        // Output: 'string' or ['string']
        return remove_required($rules);
    }
}

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email dees@owow.io instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固