2017 © Pedro Peláez
 

library laravel-custom

image

smallruraldog/laravel-custom

  • Tuesday, May 15, 2018
  • by SmallRuralDog
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 450 % Grown

The README.md

laravel-custom

laravel 5.5+ 一些自定义的扩展帮助工具, (*1)

安装

首先确保安装好了laravel, (*2)

composer require smallruraldog/laravel-custom

然后运行下面的命令来发布资源:, (*3)

php artisan vendor:publish --provider="SmallRuralDog\LaravelCustom\LaravelCustomServiceProvider"

生成配置文件 安装完成之后,所有的配置都在config/laravel-custom.php文件中。, (*4)

功能列表

  • api自定义返回工具
  • API 资源扩展

api返回工具使用

App\Exceptions\Handlerrender方法, (*5)

public function render($request, Exception $exception)
    {
        $report = LaravelCustom::ExceptionReport($exception);
        if ($report) {
            return $report;
        }
        return parent::render($request, $exception);
    }

异常拦截自定义 php //[message:自定义消息,code:状态码,status:状态] 'do-report' => [ \Illuminate\Auth\AuthenticationException::class => ['用户未授权', 401, 'error'] ], (*6)

The Versions

15/05 2018

dev-master

9999999-dev

  Sources   Download

by Avatar SmallRuralDog

15/05 2018

1.0.1

1.0.1.0

  Sources   Download

by Avatar SmallRuralDog

15/05 2018

1.0

1.0.0.0

  Sources   Download

by Avatar SmallRuralDog