2025-12-25 06:33:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
2026-01-20 20:58:32 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2025-12-25 06:33:21 +01:00
|
|
|
namespace App\Http\Requests\Api\V1;
|
|
|
|
|
|
2026-01-20 20:58:32 +01:00
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
2025-12-25 06:33:21 +01:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
2026-01-20 20:58:32 +01:00
|
|
|
/**
|
|
|
|
|
* @property string $name
|
|
|
|
|
* @property string $email
|
|
|
|
|
* @property string $password
|
|
|
|
|
*/
|
|
|
|
|
final class RegisterRequest extends FormRequest
|
2025-12-25 06:33:21 +01:00
|
|
|
{
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-20 20:58:32 +01:00
|
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
2025-12-25 06:33:21 +01:00
|
|
|
*/
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'name' => ['required', 'string', 'max:255'],
|
|
|
|
|
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
|
|
|
|
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|