PHP code example of membrane / laravel

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

    

membrane / laravel example snippets


protected $middleware = [
  \Membrane\Laravel\Middleware\RequestValidation::class,
  \Membrane\Laravel\Middleware\ResponseJsonFlat::class
  // ...
];

return Application::configure(basePath: dirname(__DIR__))
    // ...
    ->withMiddleware(function (Middleware $middleware) {
        // ...
        $middleware->appendToGroup('api', [
            \Membrane\Laravel\Middleware\RequestValidation::class,
            \Membrane\Laravel\Middleware\ResponseJsonFlat::class,
        ]);
    })
    // ...
    ->create();
text
php artisan vendor:publish --tag="membrane"