TrimStrings

laravel-pos · infra, input-sanitization, string-trimming, middleware, dev-tools

Middleware automatically trimming string inputs and converting empty strings to null.

// Source: https://github.com/angkosal/laravel-pos | License: MIT | Copyright 2023 [Laravel-POS contributors](https://github.com/angkosal/laravel-pos/graphs/contributors)
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;

class TrimStrings extends Middleware
{
    /**
     * The names of the attributes that should not be trimmed.
     *
     * @var array<int, string>
     */
    protected $except = [
        'password',
        'password_confirmation',
    ];
}

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key