PHP code example of drewlabs / laravel-http

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

    

drewlabs / laravel-http example snippets


// bootstrap/app.php
// ...
// Register the HttpService provider
$app->register(Drewlabs\Laravel\Http\HttpServiceProvider::class);
// ...

    // app/Http/Kernel.php

    // ...
    protected $middleware = [
        // ...
        \Drewlabs\Laravel\Http\Middleware\Cors::class,
    ];

    // bootstrap/app.php

    $app->middleware([
        // Other globally registered middlewares...
        \Drewlabs\Laravel\Http\Middleware\Cors::class,
    ]);
    // ...

    // app/Http/Kernel.php
    // ...
    protected $middleware = [
        // ...
        \Drewlabs\Laravel\Http\Middleware\EmptyStringToNull::class,
    ];

    // bootstrap/app.php

    $app->middleware([
        // Other globally registered middlewares...
        \Drewlabs\Laravel\Http\Middleware\EmptyStringToNull::class,
    ]);
    // ...