PHP code example of smallruraldog / laravel-custom

1. Go to this page and download the library: Download smallruraldog/laravel-custom library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

smallruraldog / laravel-custom example snippets


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


//[message:自定义消息,code:状态码,status:状态]
'do-report' => [
     \Illuminate\Auth\AuthenticationException::class => ['用户未授权', 401, 'error']
 ]
 

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