Skip to content

Commit

Permalink
fix validation not applied for ValidatedDataTransferObject interface …
Browse files Browse the repository at this point in the history
…DTOs
  • Loading branch information
d8vjork committed Oct 5, 2023
1 parent 41be27f commit d7a81ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
));
}
);
Expand All @@ -38,6 +38,6 @@ function ($dataClass, $parameters, $app) {
*/
public function register()
{
//
//
}
}

0 comments on commit d7a81ea

Please sign in to comment.