Laravel Version
12.56.0
PHP Version
8.5.3
Database Driver & Version
mysql, 11.8.6-MariaDB-ubu2404-log
Description
Illuminate\Foundation\Http\FormRequest's boolean() method isn't parsing "true" correctly as from the method's description is clear:
Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false.
On the validation step I get error: 422 field must be true or false
Steps To Reproduce
- Create any form request
- Add any rule to validate as boolean
- pass from the frontend
added-rule=true
- validate in the controller with
$request->boolean('added-rule')
- validation will fail
Laravel Version
12.56.0
PHP Version
8.5.3
Database Driver & Version
mysql, 11.8.6-MariaDB-ubu2404-log
Description
Illuminate\Foundation\Http\FormRequest'sboolean()method isn't parsing "true" correctly as from the method's description is clear:On the validation step I get error: 422 field must be true or false
Steps To Reproduce
added-rule=true$request->boolean('added-rule')