You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
371 B
PHP
15 lines
371 B
PHP
<?php
|
|
namespace App\Http\Middleware;
|
|
|
|
use Illuminate\Foundation\Http\Middleware\TransformsRequest;
|
|
|
|
class ConvertStringBooleans extends TransformsRequest
|
|
{
|
|
protected function transform($key, $value)
|
|
{
|
|
if($value === 'true' || $value === 'TRUE') return true;
|
|
if($value === 'false' || $value === 'FALSE') return false;
|
|
return $value;
|
|
}
|
|
}
|