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
PHTML

2 years ago
<?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;
}
}