34 lines
846 B
PHP
34 lines
846 B
PHP
<?php
|
|
|
|
namespace App\Modules\ApiAuth\Requests;
|
|
|
|
use App\Rules\PhoneCodeVerification;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class AuthVerifyRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<int, string>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
/**
|
|
* Phone number to authenticate
|
|
*
|
|
* @example 65707012
|
|
*/
|
|
'phone' => ['required', 'integer', 'between:61000000,65999999'],
|
|
|
|
/**
|
|
* Verification code (OTP)
|
|
*
|
|
* @example 432123
|
|
*/
|
|
'code' => ['required', 'integer', new PhoneCodeVerification($this->phone)],
|
|
];
|
|
}
|
|
}
|