This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
site-base/spark/src/Http/Requests/Settings/Security/EnableTwoFactorAuthRequest.php
2017-11-03 16:26:07 +11:00

46 lines
903 B
PHP

<?php
namespace Laravel\Spark\Http\Requests\Settings\Security;
use Illuminate\Foundation\Http\FormRequest;
class EnableTwoFactorAuthRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'country_code' => 'required|numeric',
'phone' => 'required|numeric',
];
}
/**
* Get data to be validated from the request.
*
* @return array
*/
protected function validationData()
{
if ($this->phone) {
$this->merge(['phone' => preg_replace('/[^0-9]/', '', $this->phone)]);
}
return $this->all();
}
}