From d7a81ea697e43ad4edbaf6592fea65d517c2a5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Robles?= Date: Thu, 5 Oct 2023 16:41:20 +0200 Subject: [PATCH] fix validation not applied for ValidatedDataTransferObject interface DTOs --- src/ServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 3b022a3..d9469ba 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -25,7 +25,7 @@ public function boot() function ($dataClass, $parameters, $app) { /** @var \Illuminate\Foundation\Application $app */ $app->scoped($dataClass, fn () => $dataClass::fromRequest( - app($dataClass instanceof ValidatedDataTransferObject ? $dataClass::request() : Request::class) + app(is_subclass_of($dataClass, ValidatedDataTransferObject::class) ? $dataClass::request() : Request::class) )); } ); @@ -38,6 +38,6 @@ function ($dataClass, $parameters, $app) { */ public function register() { - // + // } }