mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 20:43:56 +00:00
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Accounts\Standards\Validators;
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Accounts\DataTransferObjects\RegistrationObject;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class UserRegistrationValidation extends AbstractValidation
|
|
{
|
|
|
|
|
|
/**
|
|
* @param RegistrationObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array
|
|
{
|
|
return [
|
|
'name' => $object->getName(),
|
|
'email' => $object->getEmail(),
|
|
'password' => $object->getPassword(),
|
|
'password_confirmation' => $object->getPasswordConfirmation(),
|
|
'type' => $object->getType(),
|
|
'status' => $object->getStatus(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array
|
|
{
|
|
return [
|
|
'name' => 'required',
|
|
'email' => ['required', 'email', 'max:255', Rule::unique('users', 'email')],
|
|
'password' => 'required|min:6|confirmed',
|
|
'type' => 'required',
|
|
'status' => 'required'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
} |