admin init command
This commit is contained in:
@ -14,6 +14,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Option extends Model
|
||||
{
|
||||
const DISABLE_STATUS = 0;
|
||||
const ACTIVE_STATUS = 1;
|
||||
|
||||
protected $table = 'option';
|
||||
protected $fillable = ['key', 'value', 'label', 'status'];
|
||||
@ -29,4 +31,15 @@ class Option extends Model
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getStatus(): array
|
||||
{
|
||||
return [
|
||||
self::DISABLE_STATUS => "Не активный",
|
||||
self::ACTIVE_STATUS => "Активный",
|
||||
];
|
||||
}
|
||||
|
||||
}
|
@ -4,16 +4,22 @@ namespace kernel\modules\option\models\forms;
|
||||
|
||||
use kernel\FormModel;
|
||||
|
||||
/**
|
||||
* @property string $key
|
||||
* @property string $value
|
||||
* @property string $label
|
||||
* @property integer $status
|
||||
*/
|
||||
class CreateOptionForm extends FormModel
|
||||
{
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'admin_theme_paths' => '',
|
||||
'active_admin_theme' => '',
|
||||
'module_paths' => '',
|
||||
'active_modules' => ''
|
||||
'key' => 'required|min-str-len:1|max-str-len:50',
|
||||
'value' => '',
|
||||
'label' => '',
|
||||
'status' => ''
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user