PHP code example of escode / larax

1. Go to this page and download the library: Download escode/larax 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/ */

    

escode / larax example snippets


 'providers' => [
    Escode\Larax\LaraxServiceProvider::class,
  

use Escode\Larax\ExceptionHandler;
class Handler extends ExceptionHandler
{

return [
     //set your middleware that's allow to access exceptions pages on website
    'middleware'=>'auth',
    
    //api middleware
    'ApiMiddleware'=>'AuthLaraxApi',
    
    //exceptions data you want to store it
    'exception_data'=>[
        'ip'=>true,
        'url'=>true,
        'headers'=>true,
        'body'=>true,
    ],
    
    // Note: if you enable detect user in exception larax will push StartSession::class and EncryptCookies::class in $middleware Kernel.php
    // and you should be comment StartSession::class  from $middlewareGroups => web
   
    'detect_user'=>false,
    //array of guards names will use it for detect user id
    'guards'=>['auth'],
    
    //ignore fields in request headers (this fields not saved in db)
    'ignore_headers'=>[
        'Authorization','cookie'
    ],
    
    //ignore fields in request (this fields not saved in db)
    'ignore_inputs'=>[
        'image','password','password_confirmation'
    ],
    
    //send email when exception happened
    //enable send emails
    'enable_email'=>true,

    //email list you want send notify them with exception data
    'emails'=>[
       //example
        //'[email protected]',
    ],

]