Completed
Branch master (c64638)
by Vojta
01:51
created
Category
models/Category.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
     use ValidationTrait;
15 15
 
16
-    public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel'];
16
+    public $implement = [ '@RainLab.Translate.Behaviors.TranslatableModel' ];
17 17
 
18 18
     public $table = 'vojtasvoboda_brands_categories';
19 19
 
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
         'description' => 'max:10000',
25 25
     ];
26 26
 
27
-    public $translatable = ['name', 'slug', 'description'];
27
+    public $translatable = [ 'name', 'slug', 'description' ];
28 28
 
29
-    public $dates = ['created_at', 'updated_at', 'deleted_at'];
29
+    public $dates = [ 'created_at', 'updated_at', 'deleted_at' ];
30 30
 
31 31
     public $attachOne = [
32
-        'image' => ['System\Models\File'],
32
+        'image' => [ 'System\Models\File' ],
33 33
     ];
34 34
 
35 35
     public $belongsToMany = [
36
-        'brands' => ['VojtaSvoboa\Brands\Models\Brand',
36
+        'brands' => [ 'VojtaSvoboa\Brands\Models\Brand',
37 37
             'table' => 'vojtasvoboda_brands_brand_category',
38 38
             'order' => 'name desc',
39 39
             'scope' => 'isEnabled',
Please login to merge, or discard this patch.
models/Brand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
     use ValidationTrait;
15 15
 
16
-    public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel'];
16
+    public $implement = [ '@RainLab.Translate.Behaviors.TranslatableModel' ];
17 17
 
18 18
     public $table = 'vojtasvoboda_brands_brands';
19 19
 
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
         'description' => 'max:10000',
25 25
     ];
26 26
 
27
-    public $translatable = ['name', 'slug', 'description'];
27
+    public $translatable = [ 'name', 'slug', 'description' ];
28 28
 
29
-    public $dates = ['created_at', 'updated_at', 'deleted_at'];
29
+    public $dates = [ 'created_at', 'updated_at', 'deleted_at' ];
30 30
 
31 31
     public $attachOne = [
32
-        'logo' => ['System\Models\File'],
32
+        'logo' => [ 'System\Models\File' ],
33 33
     ];
34 34
 
35 35
     public $attachMany = [
36
-        'images' => ['System\Models\File'],
36
+        'images' => [ 'System\Models\File' ],
37 37
     ];
38 38
 
39 39
     public $belongsToMany = [
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         ], $options));
74 74
 
75 75
         // search by config
76
-        $searchableFields = ['name'];
76
+        $searchableFields = [ 'name' ];
77 77
 
78 78
         // only enabled
79 79
         if ($enabled) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         // category filtration
84 84
         if ($category instanceof Category) {
85
-            $query->whereHas('categories', function ($query) use ($category) {
85
+            $query->whereHas('categories', function($query) use ($category) {
86 86
                 $query->where('category_id', $category->id);
87 87
             });
88 88
         }
Please login to merge, or discard this patch.
Plugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,17 +41,17 @@
 block discarded – undo
41 41
                 'label' => 'vojtasvoboda.brands::lang.navigation.label',
42 42
                 'url' => Backend::url('vojtasvoboda/brands/brands'),
43 43
                 'icon' => 'icon-tags',
44
-                'permissions' => ['vojtasvoboda.brands.brands'],
44
+                'permissions' => [ 'vojtasvoboda.brands.brands' ],
45 45
                 'order' => 500,
46 46
                 'sideMenu' => [
47 47
                     'brands' => [
48
-                        'permissions' => ['vojtasvoboda.brands.brands'],
48
+                        'permissions' => [ 'vojtasvoboda.brands.brands' ],
49 49
                         'label' => 'vojtasvoboda.brands::lang.navigation.sideMenu.items',
50 50
                         'icon' => 'icon-tags',
51 51
                         'url' => Backend::url('vojtasvoboda/brands/brands'),
52 52
                     ],
53 53
                     'categories' => [
54
-                        'permissions' => ['vojtasvoboda.brands.categories'],
54
+                        'permissions' => [ 'vojtasvoboda.brands.categories' ],
55 55
                         'label' => 'vojtasvoboda.brands::lang.navigation.sideMenu.categories',
56 56
                         'icon' => 'icon-folder',
57 57
                         'url' => Backend::url('vojtasvoboda/brands/categories'),
Please login to merge, or discard this patch.
updates/create_brand_category_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
             $table->increments('id')->unsigned();
15 15
             $table->integer('brand_id')->unsigned()->nullable()->default(null);
16 16
             $table->integer('category_id')->unsigned()->nullable()->default(null);
17
-            $table->index(['brand_id', 'category_id']);
17
+            $table->index([ 'brand_id', 'category_id' ]);
18 18
             $table->foreign('brand_id')->references('id')->on('vojtasvoboda_brands_brands')->onDelete('cascade');
19 19
             $table->foreign('category_id')->references('id')->on('vojtasvoboda_brands_categories')->onDelete('cascade');
20 20
             $table->timestamps();
Please login to merge, or discard this patch.
components/Brands.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
         if ($category = $this->property('categoryFilter')) {
122 122
             $this->category = $this->getCategory($category);
123 123
         }
124
-        $this->page['category'] = $this->category;
124
+        $this->page[ 'category' ] = $this->category;
125 125
 
126 126
         // page links
127
-        $this->brandPage = $this->page['brandPage'] = $this->property('brandPage');
128
-        $this->categoryPage = $this->page['categoryPage'] = $this->property('categoryPage');
127
+        $this->brandPage = $this->page[ 'brandPage' ] = $this->property('brandPage');
128
+        $this->categoryPage = $this->page[ 'categoryPage' ] = $this->property('categoryPage');
129 129
 
130 130
         // brands vars
131
-        $this->brands = $this->page['brands'] = $this->listItems();
132
-        $this->pagePath = $this->page['pagePath'] = Request::path();
131
+        $this->brands = $this->page[ 'brands' ] = $this->listItems();
132
+        $this->pagePath = $this->page[ 'pagePath' ] = Request::path();
133 133
         $this->columnSize = 12 / $this->property('perRow');
134 134
         $this->logoWidth = $this->property('logoWidth');
135 135
         $this->logoHeight = $this->property('logoHeight');
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         ];
150 150
 
151 151
         if ($this->category) {
152
-            $parameters['category'] = $this->category;
152
+            $parameters[ 'category' ] = $this->category;
153 153
         }
154 154
 
155 155
         $items = Brand::listFrontEnd($parameters);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $detailPage = $this->brandPage;
170 170
         $categoryPage = $this->categoryPage;
171 171
 
172
-        $items->each(function ($item) use ($detailPage, $categoryPage)
172
+        $items->each(function($item) use ($detailPage, $categoryPage)
173 173
         {
174 174
             if ($item->no_link) {
175 175
                 $item->url = null;
Please login to merge, or discard this patch.
components/Brand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@
 block discarded – undo
40 40
 
41 41
     public function onRun()
42 42
     {
43
-        $this->categoryPage = $this->page['categoryPage'] = $this->property('categoryPage');
44
-        $this->item = $this->page['item'] = $this->getItem();
43
+        $this->categoryPage = $this->page[ 'categoryPage' ] = $this->property('categoryPage');
44
+        $this->item = $this->page[ 'item' ] = $this->getItem();
45 45
     }
46 46
 
47 47
     protected function getItem()
Please login to merge, or discard this patch.