priority menu item

This commit is contained in:
2024-09-24 14:57:25 +03:00
parent a48088581f
commit cb2c719b1b
12 changed files with 29 additions and 14 deletions

View File

@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\Model;
* @property string label
* @property string url
* @property int status
* @property int priority
* @method static find($id)
*/
@ -21,7 +22,7 @@ class Menu extends Model
const ACTIVE_STATUS = 1;
protected $table = 'menu';
protected $fillable = ['parent_id', 'icon_file', 'icon_font', 'label', 'url', 'status', 'slug'];
protected $fillable = ['parent_id', 'icon_file', 'icon_font', 'label', 'url', 'status', 'slug', 'priority'];
protected array $dates = ['deleted_at'];
public static function labels(): array
@ -34,6 +35,7 @@ class Menu extends Model
'url' => 'URL',
'status' => 'Статус',
'slug' => 'Slug',
'priority' => 'Приоритет'
];
}

View File

@ -11,6 +11,7 @@ use kernel\FormModel;
* @property string $label
* @property string $url
* @property int $status
* @property int priority
* @property string $slug
* @property string $parent_slug
*/
@ -26,7 +27,8 @@ class CreateMenuForm extends FormModel
'url' => 'required|min-str-len:1',
'status' => '',
'slug' => 'required|min-str-len:1|max-str-len:50',
'parent_slug' => ''
'parent_slug' => '',
'priority' => ''
];
}
}