@@ -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 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class Template extends Eloquent |
9 | 9 | { |
10 | - public function pages(){ |
|
10 | + public function pages() { |
|
11 | 11 | return $this->hasMany('Chuckbe\Chuckcms\Models\Page'); |
12 | 12 | } |
13 | 13 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $css = []; |
103 | 103 | $countCss = count($request->css_slug); |
104 | - for ($i=0; $i < $countCss; $i++) { |
|
104 | + for ($i = 0; $i < $countCss; $i++) { |
|
105 | 105 | $css[$request->css_slug[$i]]['href'] = $request->css_href[$i]; |
106 | 106 | $css[$request->css_slug[$i]]['asset'] = $request->css_asset[$i] == 1 ? 'true' : 'false'; |
107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $js = []; |
112 | 112 | $countJs = count($request->js_slug); |
113 | - for ($k=0; $k < $countJs; $k++) { |
|
113 | + for ($k = 0; $k < $countJs; $k++) { |
|
114 | 114 | $js[$request->js_slug[$k]]['href'] = $request->js_href[$k]; |
115 | 115 | $js[$request->js_slug[$k]]['asset'] = $request->js_asset[$k] == 1 ? 'true' : 'false'; |
116 | 116 | } |