-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create HasLimitParameterWithSmallerMax.php
- Loading branch information
1 parent
41a3091
commit ff2c1c9
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Dto\Concerns; | ||
|
||
use App\Rules\Attributes\MaxLimitWithFallback; | ||
use OpenApi\Annotations as OA; | ||
use Spatie\LaravelData\Attributes\Validation\IntegerType; | ||
use Spatie\LaravelData\Attributes\Validation\Min; | ||
use Spatie\LaravelData\Optional; | ||
|
||
|
||
/** | ||
* @OA\Parameter( | ||
* name="limit", | ||
* in="query", | ||
* @OA\Schema(type="integer") | ||
* ), | ||
*/ | ||
trait HasLimitParameterWithSmallerMax | ||
{ | ||
use PreparesData; | ||
|
||
#[IntegerType, Min(1), MaxLimitWithFallback(5)] | ||
public int|Optional $limit; | ||
} |