PHP code example of aporat / laravel-filter-var

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

    

aporat / laravel-filter-var example snippets


    'providers' => [
        // ...
        Aporat\FilterVar\Laravel\FilterVarServiceProvider::class,
    ];

    'aliases' => [
        // ...
        'FilterVar' => Aporat\FilterVar\Laravel\Facade\FilterVar::class,
    ];

  use Aporat\FilterVar\Laravel\Facade\FilterVar;

    $app->register(Aporat\FilterVar\Laravel\FilterVarServiceProvider::class);

$user_agent = FilterVar::filterValue('cast:string|trim|strip_tags|escape', $request->header('User-Agent'));