PHP code example of celysium / logger

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

    

celysium / logger example snippets

 
Http::withBasicAuth(env('USERNAME'), env('PASSWORD'))            
            ->withHeaders(
                [
                    'Accept'           => 'application/json',
                    'Content-Type'     => 'application/json',
                ]
            )
            ->baseUrl(env('BASE_URL'))
            ->get('')
            ->onError(function ($response) {
                throw new BadRequestHttpException($response);
            })
            ->json();

Http::loggable('name')->withBasicAuth(env('USERNAME'), env('PASSWORD'))            
            ->withHeaders(
                [
                    'Accept'           => 'application/json',
                    'Content-Type'     => 'application/json',
                ]
            )
            ->baseUrl(env('BASE_URL'))
            ->get('')
            ->onError(function ($response) {
                throw new BadRequestHttpException($response);
            })
            ->json();