Passed
Push — master ( 9b6f51...edc23e )
by Karel
08:21
created
src/Controllers/MenuController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 
109 109
         $menuitem = new MenuItems();
110 110
         $menuitem->label = request()->input("labelmenu");
111
-        $menuitem->link = 'page:'.request()->input("linkmenu");
111
+        $menuitem->link = 'page:' . request()->input("linkmenu");
112 112
         $menuitem->menu = request()->input("idmenu");
113 113
         $menuitem->sort = MenuItems::getNextSortRoot(request()->input("idmenu"));
114 114
         $menuitem->save();
Please login to merge, or discard this patch.
src/Models/MenuItems.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.
src/Models/Menus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.