Completed
Push — master ( f3c73f...660e59 )
by Glenn
03:41 queued 01:27
created
app/Http/Controllers/StaffController.php 4 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,7 @@
 block discarded – undo
5 5
 use App\Departments;
6 6
 use App\User;
7 7
 use App\Roles;
8
-
9 8
 use Chrisbjr\ApiGuard\Models\ApiKey;
10
-use Illuminate\Http\Request;
11
-
12 9
 use App\Http\Requests;
13 10
 use Bouncer;
14 11
 
Please login to merge, or discard this patch.
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -64,36 +64,36 @@  discard block
 block discarded – undo
64 64
 
65 65
         if ($user->is('Manager') || $user->is('Administrator'))
66 66
         {
67
-          $password = $faker->password;
68
-          // Save the user to the database.
69
-          $NewUser = User::create(
67
+            $password = $faker->password;
68
+            // Save the user to the database.
69
+            $NewUser = User::create(
70 70
             [
71
-              'fname'     => $input->fname,
72
-              'name'      => $input->name,
73
-              'email'     => $input->email,
74
-              'password'  => \Hash::make($password),
75
-              'biography' => nl2br($input->biography),
71
+                'fname'     => $input->fname,
72
+                'name'      => $input->name,
73
+                'email'     => $input->email,
74
+                'password'  => \Hash::make($password),
75
+                'biography' => nl2br($input->biography),
76 76
             ]
77
-          )->id;
78
-          // Assign the user to the selected department
77
+            )->id;
78
+            // Assign the user to the selected department
79 79
             User::find($NewUser)->departments()->attach($input->department);
80
-          // Assign the user to the selected role.
80
+            // Assign the user to the selected role.
81 81
             Bouncer::assign($input->role)->to($user);
82
-         // Send a confirmation mail to the user.
82
+            // Send a confirmation mail to the user.
83 83
             Mail::send('emails.welcome', ['user' => $NewUser, 'password' => $password], function ($message) use ($user)
84 84
             {
85
-              $message->from(env('MAIL_USERNAME'));
86
-              $message->to('[email protected]', 'John Smith')->subject('Welcome to Ring Me!');
85
+                $message->from(env('MAIL_USERNAME'));
86
+                $message->to('[email protected]', 'John Smith')->subject('Welcome to Ring Me!');
87 87
             }
88
-          );
89
-          session()->flash('message', 'The new user has been created and is assigned to his department and role.');
90
-          return redirect("staff");
91
-         }
92
-         else
93
-         {
94
-          return redirect()->back(302);
95
-         }
96
-       }
88
+            );
89
+            session()->flash('message', 'The new user has been created and is assigned to his department and role.');
90
+            return redirect("staff");
91
+            }
92
+            else
93
+            {
94
+            return redirect()->back(302);
95
+            }
96
+        }
97 97
 
98 98
     /**
99 99
      * Update the staff member.
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
129 129
      */
130 130
     public function index()
131
-	{
131
+    {
132 132
         $data["departments"] = Departments::all();
133
-		$data['users'] = User::paginate(15);
134
-    	return view('users/index', $data);
133
+        $data['users'] = User::paginate(15);
134
+        return view('users/index', $data);
135 135
     }
136 136
 
137 137
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     {
172 172
         $id = auth()->user()->id;
173 173
         $data['tokens'] = ApiKey::where('user_id', $id)->get();
174
-    	return view('users/profile', $data);
174
+        return view('users/profile', $data);
175 175
     }
176 176
 
177 177
     /**
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
         session()->flash('message', 'The user has been removed.');
194 194
 
195 195
         return redirect()->to('/staff');
196
-      }
197
-      else
198
-      {
196
+        }
197
+        else
198
+        {
199 199
         return redirect()->back();
200
-      }
200
+        }
201 201
     }
202 202
 
203 203
     public function get_roles()
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $data2 = [];
207 207
         foreach($items as $role)
208 208
         {
209
-         $data2[] = [
209
+            $data2[] = [
210 210
         'value' => $role["id"],
211 211
         'text'  => $role["name"]
212 212
         ];
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
         $user = auth()->user();
42 42
 
43 43
         if ($user->is('Manager') || $user->is('Administrator')) {
44
-            $data['departments'] = Departments::all();
45
-            $data['roles'] = Roles::all();
44
+            $data[ 'departments' ] = Departments::all();
45
+            $data[ 'roles' ] = Roles::all();
46 46
 
47 47
             return view('staff.create', $data);
48 48
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
           // Assign the user to the selected role.
81 81
             Bouncer::assign($input->role)->to($user);
82 82
          // Send a confirmation mail to the user.
83
-            Mail::send('emails.welcome', ['user' => $NewUser, 'password' => $password], function ($message) use ($user)
83
+            Mail::send('emails.welcome', [ 'user' => $NewUser, 'password' => $password ], function($message) use ($user)
84 84
             {
85 85
               $message->from(env('MAIL_USERNAME'));
86 86
               $message->to('[email protected]', 'John Smith')->subject('Welcome to Ring Me!');
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function update(Requests\NewStaffValidator $input, $id)
107 107
     {
108
-        User::find($id)-update($input->except('_token'));
108
+        User::find($id) - update($input->except('_token'));
109 109
         //session()->flash('message', 'Staff member has been updated');
110 110
 
111 111
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function edit($id)
120 120
     {
121
-        $data['query'] = User::find($id);
121
+        $data[ 'query' ] = User::find($id);
122 122
         return view('staff.edit', $data);
123 123
     }
124 124
 
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
      */
130 130
     public function index()
131 131
 	{
132
-        $data["departments"] = Departments::all();
133
-		$data['users'] = User::paginate(15);
132
+        $data[ "departments" ] = Departments::all();
133
+		$data[ 'users' ] = User::paginate(15);
134 134
     	return view('users/index', $data);
135 135
     }
136 136
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     public function profile()
171 171
     {
172 172
         $id = auth()->user()->id;
173
-        $data['tokens'] = ApiKey::where('user_id', $id)->get();
173
+        $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get();
174 174
     	return view('users/profile', $data);
175 175
     }
176 176
 
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
     {
185 185
         $user = auth()->user();
186 186
 
187
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
187
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
188 188
 
189 189
         $user = User::find($id);
190
-        $user->roles()->sync([]);
190
+        $user->roles()->sync([ ]);
191 191
 
192 192
         User::destroy($id);
193 193
         session()->flash('message', 'The user has been removed.');
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
     public function get_roles()
204 204
     {
205 205
         $items = Roles::all();
206
-        $data2 = [];
207
-        foreach($items as $role)
206
+        $data2 = [ ];
207
+        foreach ($items as $role)
208 208
         {
209
-         $data2[] = [
210
-        'value' => $role["id"],
211
-        'text'  => $role["name"]
209
+         $data2[ ] = [
210
+        'value' => $role[ "id" ],
211
+        'text'  => $role[ "name" ]
212 212
         ];
213 213
 
214 214
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,8 +88,7 @@  discard block
 block discarded – undo
88 88
           );
89 89
           session()->flash('message', 'The new user has been created and is assigned to his department and role.');
90 90
           return redirect("staff");
91
-         }
92
-         else
91
+         } else
93 92
          {
94 93
           return redirect()->back(302);
95 94
          }
@@ -193,8 +192,7 @@  discard block
 block discarded – undo
193 192
         session()->flash('message', 'The user has been removed.');
194 193
 
195 194
         return redirect()->to('/staff');
196
-      }
197
-      else
195
+      } else
198 196
       {
199 197
         return redirect()->back();
200 198
       }
Please login to merge, or discard this patch.
app/Roles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,5 +19,5 @@
 block discarded – undo
19 19
      *
20 20
      * @var array
21 21
      */
22
-    protected $fillable = ['name'];
22
+    protected $fillable = [ 'name' ];
23 23
 }
Please login to merge, or discard this patch.
app/Http/Controllers/RolesController.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
      */
17 17
     public function index()
18 18
     {
19
-    	$data['roles'] = Roles::all();
20
-    	return view('roles.index', $data);
19
+        $data['roles'] = Roles::all();
20
+        return view('roles.index', $data);
21 21
     }
22 22
 
23 23
     /**
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-use App\Http\Requests;
7 6
 use Silber\Bouncer\Database\Constraints\Roles;
8 7
 
9 8
 class RolesController extends Controller
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public function index()
18 18
     {
19
-    	$data['roles'] = Roles::all();
19
+    	$data[ 'roles' ] = Roles::all();
20 20
     	return view('roles.index', $data);
21 21
     }
22 22
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public function search(Request $request)
30 30
     {
31 31
         $term = $request->get('term');
32
-        $data['roles'] = Roles::where('name', 'LIKE', "$term")->get();
32
+        $data[ 'roles' ] = Roles::where('name', 'LIKE', "$term")->get();
33 33
         return view('roles.index', $data);
34 34
     }
35 35
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function show($id)
43 43
     {
44
-        $data['query'] = Roles::find($id);
44
+        $data[ 'query' ] = Roles::find($id);
45 45
         return view('roles.specific', $data);
46 46
     }
47 47
 
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function edit($id)
77 77
     {
78
-        $data['query'] = Roles::find($id);
79
-        $data['permissions'] = Permissions::orderBy('name', 'asc')->get();
78
+        $data[ 'query' ] = Roles::find($id);
79
+        $data[ 'permissions' ] = Permissions::orderBy('name', 'asc')->get();
80 80
 
81 81
         return view('roles.edit', $data);
82 82
     }
Please login to merge, or discard this patch.
app/Http/Controllers/BackupController.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use App\Customer;
6
-use Illuminate\Http\Request;
7
-
8 6
 use App\Http\Requests;
9 7
 
10 8
 class CustomersController extends Controller
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 class BackupController extends Controller
11 11
 {
12
-	    public function __construct()
12
+        public function __construct()
13 13
     {
14 14
         $this->middleware('auth');
15 15
         $this->middleware('lang');
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $data['MonthlyBackups']    = Config::get('laravel-backup.cleanup.defaultStrategy.keepMonthlyBackupsForMonths');
31 31
         $data['KeepYearlyBackups'] = Config::get('laravel-backup.cleanup.defaultStrategy.keepYearlyBackupsForYears');
32 32
 
33
-    	return view('settings.backups', $data);
33
+        return view('settings.backups', $data);
34 34
     }
35 35
 
36 36
     /**
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
     {
25 25
 
26 26
         // Config data
27
-        $data['StoreAllBackups']   = Config::get('laravel-backup.cleanup.defaultStrategy.keepAllBackupsForDays');
28
-        $data['KeepDailyBackups']  = Config::get('laravel-backup.cleanup.defaultStrategy.keepDailyBackupsForDays');
29
-        $data['WeeklyBackups']     = Config::get('laravel-backup.cleanup.defaultStrategy.keepWeeklyBackupsForWeeks');
30
-        $data['MonthlyBackups']    = Config::get('laravel-backup.cleanup.defaultStrategy.keepMonthlyBackupsForMonths');
31
-        $data['KeepYearlyBackups'] = Config::get('laravel-backup.cleanup.defaultStrategy.keepYearlyBackupsForYears');
27
+        $data[ 'StoreAllBackups' ]   = Config::get('laravel-backup.cleanup.defaultStrategy.keepAllBackupsForDays');
28
+        $data[ 'KeepDailyBackups' ]  = Config::get('laravel-backup.cleanup.defaultStrategy.keepDailyBackupsForDays');
29
+        $data[ 'WeeklyBackups' ]     = Config::get('laravel-backup.cleanup.defaultStrategy.keepWeeklyBackupsForWeeks');
30
+        $data[ 'MonthlyBackups' ]    = Config::get('laravel-backup.cleanup.defaultStrategy.keepMonthlyBackupsForMonths');
31
+        $data[ 'KeepYearlyBackups' ] = Config::get('laravel-backup.cleanup.defaultStrategy.keepYearlyBackupsForYears');
32 32
 
33 33
     	return view('settings.backups', $data);
34 34
     }
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
     public function storeBackup(Requests\BackupSettingValidator $input)
44 44
     {
45 45
         $config = new \Larapack\ConfigWriter\Repository('laravel-backup');
46
-        $config->set('cleanup.defaultStrategy.keepAllBackupsForDays',       $input->keepAllBackupsForDaysAll);
47
-        $config->set('cleanup.defaultStrategy.keepDailyBackupsForDays',     $input->keepAllBackupsForDays);
48
-        $config->set('cleanup.defaultStrategy.keepWeeklyBackupsForWeeks',   $input->keepWeeklyBackupsForWeeks);
46
+        $config->set('cleanup.defaultStrategy.keepAllBackupsForDays', $input->keepAllBackupsForDaysAll);
47
+        $config->set('cleanup.defaultStrategy.keepDailyBackupsForDays', $input->keepAllBackupsForDays);
48
+        $config->set('cleanup.defaultStrategy.keepWeeklyBackupsForWeeks', $input->keepWeeklyBackupsForWeeks);
49 49
         $config->set('cleanup.defaultStrategy.keepMonthlyBackupsForMonths', $input->keepMonthlyBackupsForWeeks);
50
-        $config->set('cleanup.defaultStrategy.keepYearlyBackupsForYears',   $input->keepAllBackupsYearly);
50
+        $config->set('cleanup.defaultStrategy.keepYearlyBackupsForYears', $input->keepAllBackupsYearly);
51 51
         $config->save();
52 52
 
53 53
         if ($config) {
Please login to merge, or discard this patch.
app/Http/Controllers/ProfileController.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,11 +3,8 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use App\User;
6
-use Illuminate\Http\Request;
7
-
8 6
 use App\Http\Requests;
9 7
 use Illuminate\Support\Facades\Input;
10
-use Illuminate\Support\Facades\Storage;
11 8
 use Intervention\Image\Facades\Image;
12 9
 
13 10
 class ProfileController extends Controller
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
     public function updateProfile(Requests\ProfileValidator $input)
31 31
     {
32 32
         // User information
33
-        User::find(auth()->user()->id)->update($input->except(['_token', 'avatar']));
33
+        User::find(auth()->user()->id)->update($input->except([ '_token', 'avatar' ]));
34 34
 
35 35
         // User image information.
36 36
         if (Input::file()) {
37 37
             $image    = Input::file('avatar');
38
-            $filename = time() . '.' . $image->getClientOriginalExtension();
39
-            $path     = public_path('avatars/' . $filename);
38
+            $filename = time().'.'.$image->getClientOriginalExtension();
39
+            $path     = public_path('avatars/'.$filename);
40 40
             
41 41
             //Image::make($image->getRealPath())->resize(80, 80)->save($path);
42 42
             $image->move(public_path('avatars'), $filename);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function updateSecurity(Requests\PasswordValidation $input)
60 60
     {
61
-        $data['password'] = bcrypt($input->password);
61
+        $data[ 'password' ] = bcrypt($input->password);
62 62
 
63 63
         User::find(auth()->user()->id)->update($data);
64 64
         session()->flash('message', 'Your password has been updated.');
Please login to merge, or discard this patch.
app/Http/Controllers/SettingsController.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     // TODO: Needs phpunit tests. -> create github issue
12 12
 
13
-	/**
13
+    /**
14 14
      * SettingsController constructor.
15 15
      */
16 16
     public function __construct()
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function index()
28 28
     {
29
-    	return view('settings.index');
29
+        return view('settings.index');
30 30
     }
31 31
 
32
-		/**
33
-		 * Get the email settings page.
34
-		 *
35
-		 * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
36
-		 */
37
-		public function email()
38
-		{
39
-			return view('settings.email');
40
-		}
32
+        /**
33
+         * Get the email settings page.
34
+         *
35
+         * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
36
+         */
37
+        public function email()
38
+        {
39
+            return view('settings.email');
40
+        }
41 41
 
42 42
 }
Please login to merge, or discard this patch.
app/ProductsCategories.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,5 +19,5 @@
 block discarded – undo
19 19
      *
20 20
      * @var array
21 21
      */
22
-    protected $fillable = ['name'];
22
+    protected $fillable = [ 'name' ];
23 23
 }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
  */
11 11
 class ProductsCategories extends Model
12 12
 {
13
-  /**
14
-   * Model table.
15
-   *
16
-   * @var string
17
-   */
18
-  protected $table = 'products_categories';
13
+    /**
14
+     * Model table.
15
+     *
16
+     * @var string
17
+     */
18
+    protected $table = 'products_categories';
19 19
 
20 20
     /**
21 21
      * Mass-assign fields
Please login to merge, or discard this patch.
app/Products.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      *
23 23
      * @var array
24 24
      */
25
-    protected $fillable = ['name', 'category_id'];
25
+    protected $fillable = [ 'name', 'category_id' ];
26 26
 
27 27
 
28 28
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/ProductsController.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use App\Departments;
6 6
 use Illuminate\Http\Request;
7
-
8 7
 use App\Http\Requests;
9 8
 
10 9
 /**
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function edit_categories($id)
37 37
     {
38
-      $data['category'] = ProductsCategories::find($id);
39
-      return view('products.edit_category', $data);
38
+        $data['category'] = ProductsCategories::find($id);
39
+        return view('products.edit_category', $data);
40 40
     }
41 41
 
42 42
     public function remove_category($id)
43 43
     {
44
-      $category = ProductsCategories::find($id);
45
-      $category->delete();
44
+        $category = ProductsCategories::find($id);
45
+        $category->delete();
46 46
 
47
-      session()->flash('message', trans('products.removed_category'));
48
-      return redirect()->back();
47
+        session()->flash('message', trans('products.removed_category'));
48
+        return redirect()->back();
49 49
     }
50 50
 
51 51
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
     public function store(Requests\ProductValidator $input)
62 62
     {
63 63
         $this->validate($input, [
64
-          'name' => 'required',
65
-          'category' => 'required',
66
-         ]);
64
+            'name' => 'required',
65
+            'category' => 'required',
66
+            ]);
67 67
 
68 68
         $product       = new Products();
69 69
         $product->name = $input->name;
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function saveCat(Request $input)
87 87
     {
88
-      $this->validate($input, [
88
+        $this->validate($input, [
89 89
         'name' => 'required|unique:products_categories'
90
-       ]);
90
+        ]);
91 91
 
92 92
         $category       = new ProductsCategories();
93 93
         $category->name = $input->name;
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
     public function remove($id)
102 102
     {
103
-      $product = Products::find($id);
104
-      $product->delete();
103
+        $product = Products::find($id);
104
+        $product->delete();
105 105
 
106
-      session()->flash('message', trans('products.removed'));
107
-      return redirect()->back();
106
+        session()->flash('message', trans('products.removed'));
107
+        return redirect()->back();
108 108
     }
109 109
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,21 +21,21 @@
 block discarded – undo
21 21
 
22 22
     public function index()
23 23
     {
24
-        $data['products'] = Products::with('category')->paginate(10);
25
-        $data['category'] = ProductsCategories::with('products')->paginate(10)->sortBy("name")->all();
24
+        $data[ 'products' ] = Products::with('category')->paginate(10);
25
+        $data[ 'category' ] = ProductsCategories::with('products')->paginate(10)->sortBy("name")->all();
26 26
 
27 27
         return view('products.index', $data);
28 28
     }
29 29
 
30 30
     public function categories()
31 31
     {
32
-        $data['category'] = ProductsCategories::with('products')->paginate(10)->sortBy("name")->all();
32
+        $data[ 'category' ] = ProductsCategories::with('products')->paginate(10)->sortBy("name")->all();
33 33
         return view('products.categories', $data);
34 34
     }
35 35
 
36 36
     public function edit_categories($id)
37 37
     {
38
-      $data['category'] = ProductsCategories::find($id);
38
+      $data[ 'category' ] = ProductsCategories::find($id);
39 39
       return view('products.edit_category', $data);
40 40
     }
41 41
 
Please login to merge, or discard this patch.