29 lines
857 B
PHP
29 lines
857 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Domain\Role\Data;
|
|
|
|
use Spatie\LaravelData\Attributes\MapName;
|
|
use Spatie\LaravelData\Attributes\Validation\IntegerType;
|
|
use Spatie\LaravelData\Attributes\Validation\Min;
|
|
use Spatie\LaravelData\Attributes\Validation\Nullable;
|
|
use Spatie\LaravelData\Attributes\Validation\StringType;
|
|
use Spatie\LaravelData\Data;
|
|
use Spatie\LaravelData\Mappers\SnakeCaseMapper;
|
|
|
|
#[MapName(SnakeCaseMapper::class)]
|
|
class IndexRequest extends Data
|
|
{
|
|
public function __construct(
|
|
#[IntegerType, Min(1), Nullable]
|
|
public readonly ?int $page = 1,
|
|
#[IntegerType, Min(1), Nullable]
|
|
public readonly ?int $per_page = 15,
|
|
#[StringType, Nullable]
|
|
public readonly ?string $sort_by = 'name',
|
|
#[StringType, Nullable]
|
|
public readonly ?string $sort_dir = 'asc',
|
|
) {
|
|
}
|
|
} |