File: /home/xedaptot/hi.naniguide.com/app/Http/Requests/Admin/UserStoreRequest.php
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
class UserStoreRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email'],
'password' => ['required', 'confirmed', Password::defaults()],
'timezone' => ['nullable', 'string', 'max:255'],
'language' => ['nullable', 'string', 'max:10'],
'status' => ['required', 'in:active,inactive,banned'],
'user_group_ids' => ['nullable', 'array'],
'user_group_ids.*' => ['nullable', 'integer', 'exists:user_groups,id'],
];
}
}