2024-07-24 14:07:45 +03:00
|
|
|
<?php
|
|
|
|
|
2024-09-10 15:45:12 +03:00
|
|
|
namespace kernel\modules\user\models\forms;
|
2024-07-24 14:07:45 +03:00
|
|
|
|
|
|
|
use kernel\FormModel;
|
|
|
|
|
|
|
|
class CreateUserForm extends FormModel
|
|
|
|
{
|
|
|
|
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'username' => 'required|min-str-len:5|max-str-len:30',
|
|
|
|
'password' => 'required|min-str-len:5|max-str-len:30',
|
2024-12-25 16:32:23 +03:00
|
|
|
'email' => 'required|email',
|
|
|
|
'user_photo' => ''
|
2024-07-24 14:07:45 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-12-03 12:13:18 +03:00
|
|
|
public function rulesForUpdate(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'username' => 'required|min-str-len:5|max-str-len:30',
|
|
|
|
'password' => '',
|
2024-12-25 16:32:23 +03:00
|
|
|
'email' => 'required|email',
|
|
|
|
'user_photo' => ''
|
|
|
|
|
2024-12-03 12:13:18 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-07-24 14:07:45 +03:00
|
|
|
}
|