option CRUD

This commit is contained in:
2024-09-23 15:33:48 +03:00
parent f4971f1c7d
commit 0f05bc2391
35 changed files with 737 additions and 147 deletions

View File

@ -0,0 +1,32 @@
<?php
namespace kernel\modules\option\models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $key
* @property array|string $value
* @property string $label
* @property int $status
*/
class Option extends Model
{
protected $table = 'option';
protected $fillable = ['key', 'value', 'label', 'status'];
protected array $dates = ['created_at', 'updated_at'];
public static function labels()
{
return [
'key' => 'Ключ',
'value' => 'Значение',
'label' => 'Название',
'status' => 'Статус'
];
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace kernel\modules\option\models\forms;
use kernel\FormModel;
class CreateOptionForm extends FormModel
{
public function rules(): array
{
return [
'admin_theme_paths' => '',
'active_admin_theme' => '',
'module_paths' => '',
'active_modules' => ''
];
}
}