承接 johnvict/error-format 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

johnvict/error-format

Composer 安装命令:

composer require johnvict/error-format

包简介

Error-Format helps you do validation and returns a more pleasing error object if there is one or more, using Laravel In-built Validator

README 文档

README

Error Format is used to format error on laravel/lumen framework. It restructures the error object to a simpler-to-use error object

Installation

Use composer to install Error Format.

composer require johnvict/error-format

Usage

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Johnvict\ErrorFormat\Services\ErrorFormat;

class ExampleController extends Controller
{
	/**
	 * Add the ErrorFormat trait to your controller to enable the use of validate request as part of the controller class
	 */
	use ErrorFormat;

    public function home(Request $request) {
		// You can define an array of your validation rule
		$errorRule = [
			"name" => "required|string",
			"phone" => "required|string",
			"username" => "required|string",
			"email" => "email"
		];
		// call the validateRequest as follows
		$error = self::validateRequest($request, $errorRule);
		return response()->json($error);
	}
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固