Skip to content

Commit e410342

Browse files
feat(state): cast parameter values to validate with the Type constraint (#7240)
1 parent f31cd95 commit e410342

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

workbench/app/Models/Book.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
use Illuminate\Database\Eloquent\Factories\HasFactory;
3838
use Illuminate\Database\Eloquent\Model;
3939
use Illuminate\Database\Eloquent\Relations\BelongsTo;
40+
use Symfony\Component\TypeInfo\Type\BuiltinType;
41+
use Symfony\Component\TypeInfo\TypeIdentifier;
4042
use Workbench\App\Http\Requests\BookFormRequest;
4143

4244
#[ApiResource(
@@ -79,7 +81,7 @@
7981
property: 'name'
8082
)]
8183
#[QueryParameter(key: 'properties', filter: PropertyFilter::class)]
82-
#[QueryParameter(key: 'published', filter: BooleanFilter::class)]
84+
#[QueryParameter(key: 'published', filter: BooleanFilter::class, nativeType: new BuiltinType(TypeIdentifier::BOOL))]
8385
class Book extends Model
8486
{
8587
use HasFactory;

0 commit comments

Comments
 (0)