Skip to content

Commit e107122

Browse files
committed
add MenuItem model
1 parent ff7f8b8 commit e107122

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Models\Cms;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class MenuItem extends Model
8+
{
9+
protected $fillable = [
10+
'text',
11+
'path',
12+
'parent_menu_item_id',
13+
'order',
14+
'active'
15+
];
16+
17+
public static $validator = [
18+
'text' => 'required|string',
19+
'path' => 'required|string',
20+
'parent_menu_item_id' => 'nullable|exists:menu_items,id',
21+
'order' => 'nullable|numeric',
22+
'active' => 'boolean',
23+
];
24+
}

templates/cms/app/Resources/CRUD.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class CRUD
1111
'resources' => [
1212
['path' => 'messages', 'controller' => 'MessagesController', 'model' => 'App\Models\Cms\Message'],
1313
['path' => 'settings', 'controller' => 'SettingsController', 'model' => 'App\Models\Cms\Settings'],
14+
['path' => 'menu-items', 'controller' => 'MenuItemsController', 'model' => 'App\Models\Cms\MenuItem'],
1415
],
1516
],
1617
[

0 commit comments

Comments
 (0)