phpvms/app/Http/Requests/CreateUserRequest.php
Nabeel S a1d6fa17ad
Respect home hubs setting for registration #580 (#581)
Respect home hubs setting for registration #580
2020-02-23 17:21:26 -05:00

46 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
class CreateUserRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
$rules = [
'name' => 'required',
'email' => 'required|email|unique:users,email',
'airline_id' => 'required',
'home_airport_id' => 'required',
'password' => 'required|confirmed',
'timezone' => 'required',
'country' => 'required',
'transfer_time' => 'sometimes|integer|min:0',
'toc_accepted' => 'accepted',
];
if (config('captcha.enabled')) {
$rules['g-recaptcha-response'] = 'required|captcha';
}
return $rules;
}
}