@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'label', 'link', 'parent', 'sort', 'class', 'menu', 'depth' |
29 | 29 | ]; |
30 | 30 | |
31 | - public function __construct( array $attributes = [] ){ |
|
31 | + public function __construct(array $attributes = []) { |
|
32 | 32 | //parent::construct( $attributes ); |
33 | 33 | $this->table = config('menu.table_prefix') . config('menu.table_name_items'); |
34 | 34 | } |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | return $this -> where("menu", $id) -> orderBy("sort", "asc")->get(); |
41 | 41 | } |
42 | 42 | |
43 | - public static function getNextSortRoot($menu){ |
|
44 | - return self::where('menu',$menu)->max('sort') + 1; |
|
43 | + public static function getNextSortRoot($menu) { |
|
44 | + return self::where('menu', $menu)->max('sort') + 1; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getLinkAttribute() |
48 | 48 | { |
49 | - if(strpos($this->attributes['link'], 'page:') !== false ) { |
|
49 | + if (strpos($this->attributes['link'], 'page:') !== false) { |
|
50 | 50 | $page_id = explode(':', $this->attributes['link'])[1]; |
51 | 51 | return Page::getUrl($page_id); |
52 | 52 | } else { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function getTypeAttribute() |
63 | 63 | { |
64 | - if(strpos($this->attributes['link'], 'page:') !== false ) { |
|
64 | + if (strpos($this->attributes['link'], 'page:') !== false) { |
|
65 | 65 | return 'Page'; |
66 | 66 | } else { |
67 | 67 | return 'Link'; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | 'name' |
22 | 22 | ]; |
23 | 23 | |
24 | - public function __construct( array $attributes = [] ){ |
|
24 | + public function __construct(array $attributes = []) { |
|
25 | 25 | //parent::construct( $attributes ); |
26 | 26 | $this->table = config('menu.table_prefix') . config('menu.table_name_menus'); |
27 | 27 | } |