laravel-data/tests/Casters/SimpleValueCaster.php
2026-02-18 20:29:13 -03:00

20 lines
335 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Casters;
class SimpleValueCaster
{
public function cast(mixed $value): SimpleValue
{
return new SimpleValue($value['value'] * 2);
}
public static function rules(): array
{
return [
'value' => ['required', 'numeric'],
];
}
}