Completed
Pull Request — master (#91)
by Tim
02:42
created
app/Http/Controllers/StaffController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
89 89
      */
90 90
     public function index()
91
-	{
91
+    {
92 92
         $data["departments"] = Departments::all();
93
-		$data['users'] = User::paginate(15);
94
-    	return view('users/index', $data);
93
+        $data['users'] = User::paginate(15);
94
+        return view('users/index', $data);
95 95
     }
96 96
 
97 97
     /**
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         $id = auth()->user()->id;
133 133
         $data['tokens'] = ApiKey::where('user_id', $id)->get();
134
-    	return view('users/profile', $data);
134
+        return view('users/profile', $data);
135 135
     }
136 136
 
137 137
     /**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $data2 = [];
158 158
         foreach($items as $role)
159 159
         {
160
-         $data2[] = [
160
+            $data2[] = [
161 161
         'value' => $role["id"],
162 162
         'text'  => $role["name"]
163 163
         ];
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $user = auth()->user();
40 40
 
41 41
         if ($user->is('Manager') || $user->is('Administrator')) {
42
-            $data['departments'] = Departments::all();
42
+            $data[ 'departments' ] = Departments::all();
43 43
             return view('staff.create', $data);
44 44
         }
45 45
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $user = auth()->user();
59 59
 
60 60
         if ($user->is('Manager') || $user->is('Administrator')) {
61
-            $newUser = User::create($input->except(['_token', 'department']))->id;
61
+            $newUser = User::create($input->except([ '_token', 'department' ]))->id;
62 62
             User::find($newUser)->departments()->attach($input->department);
63 63
 
64 64
             session()->flash('message', 'New staff member created');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function update(Requests\NewStaffValidator $input, $id)
79 79
     {
80
-        User::find($id)-update($input->except('_token'));
80
+        User::find($id) - update($input->except('_token'));
81 81
         //session()->flash('message', 'Staff member has been updated');
82 82
 
83 83
     }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function edit($id)
92 92
     {
93
-        $data['query'] = User::find($id);
93
+        $data[ 'query' ] = User::find($id);
94 94
         return view('staff.edit', $data);
95 95
     }
96 96
 
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function index()
103 103
 	{
104
-        $data["departments"] = Departments::all();
105
-		$data['users'] = User::paginate(15);
104
+        $data[ "departments" ] = Departments::all();
105
+		$data[ 'users' ] = User::paginate(15);
106 106
     	return view('users/index', $data);
107 107
     }
108 108
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function profile()
143 143
     {
144 144
         $id = auth()->user()->id;
145
-        $data['tokens'] = ApiKey::where('user_id', $id)->get();
145
+        $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get();
146 146
     	return view('users/profile', $data);
147 147
     }
148 148
 
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $user = auth()->user();
158 158
 
159
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
159
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
160 160
             return redirect()->back();
161 161
         }
162 162
 
163 163
         $user = User::find($id);
164
-        $user->roles()->sync([]);
164
+        $user->roles()->sync([ ]);
165 165
 
166 166
         User::destroy($id);
167 167
         session()->flash('message', 'User deleted');
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
     public function get_roles()
173 173
     {
174 174
         $items = Roles::all();
175
-        $data2 = [];
176
-        foreach($items as $role)
175
+        $data2 = [ ];
176
+        foreach ($items as $role)
177 177
         {
178
-         $data2[] = [
179
-        'value' => $role["id"],
180
-        'text'  => $role["name"]
178
+         $data2[ ] = [
179
+        'value' => $role[ "id" ],
180
+        'text'  => $role[ "name" ]
181 181
         ];
182 182
 
183 183
         }
Please login to merge, or discard this patch.
app/Http/Controllers/BackupController.php 2 patches
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/CustomersController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function index()
29 29
     {
30
-        $data['customers'] = Customer::paginate(15);
30
+        $data[ 'customers' ] = Customer::paginate(15);
31 31
         return view('customers/index', $data);
32 32
     }
33 33
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $user = auth()->user();
42 42
 
43 43
         if ($user->is('Guest') || $user->is('Agent') || $user->is('Manager') || $user->is('Administrator')) {
44
-            $data['countries'] = Countries::all();
44
+            $data[ 'countries' ] = Countries::all();
45 45
             return view('customers/register', $data);
46 46
         }
47 47
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $user = auth()->user();
60 60
 
61
-        if (! $user->is('Guest') || ! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
61
+        if (!$user->is('Guest') || !$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
62 62
             return redirect()->back();
63 63
         }
64 64
 
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
     {
78 78
         $user = auth()->user();
79 79
 
80
-        if (! $user->is('Customer') || ! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
80
+        if (!$user->is('Customer') || !$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
81 81
             return redirect()->back();
82 82
         }
83 83
 
84
-        $data['customer'] = Customer::where('id', $id)->get();
84
+        $data[ 'customer' ] = Customer::where('id', $id)->get();
85 85
         return view('customers/edit', $data);
86 86
     }
87 87
 }
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/Http/Controllers/CallbackController.php 3 patches
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.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $data['callback'] = Callback::all();
35 35
         $data['users'] = User::all();
36
-    	return view('callbacks/list', $data);
36
+        return view('callbacks/list', $data);
37 37
     }
38 38
 
39 39
 
@@ -62,22 +62,22 @@  discard block
 block discarded – undo
62 62
     {
63 63
         $user = auth()->user();
64 64
 
65
-      //  Callback::create($input->except('_token', 'product', 'description'));
65
+        //  Callback::create($input->except('_token', 'product', 'description'));
66 66
 
67
-      $Callback = new Callback;
67
+        $Callback = new Callback;
68 68
 
69
-      $Callback->type = $request->type;
70
-      $Callback->customer = $user->id;
71
-      $Callback->agent_id = '1';
72
-      $Callback->description = $request->description;
69
+        $Callback->type = $request->type;
70
+        $Callback->customer = $user->id;
71
+        $Callback->agent_id = '1';
72
+        $Callback->description = $request->description;
73 73
 
74
-      $Callback->save();
74
+        $Callback->save();
75 75
 
76 76
         Mail::send('emails.request', ['user' => $user, 'callback' => $Callback], function ($m) use ($user) {
77
-           $m->from('[email protected]', 'Ring Me');
77
+            $m->from('[email protected]', 'Ring Me');
78 78
 
79
-           $m->to("[email protected]", 'Glenn')->subject('Call back request!');
80
-       });
79
+            $m->to("[email protected]", 'Glenn')->subject('Call back request!');
80
+        });
81 81
         return back();
82 82
     }
83 83
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function index()
33 33
     {
34
-        $data['callback'] = Callback::all();
35
-        $data['users'] = User::all();
34
+        $data[ 'callback' ] = Callback::all();
35
+        $data[ 'users' ] = User::all();
36 36
     	return view('callbacks/list', $data);
37 37
     }
38 38
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $user = auth()->user();
48 48
 
49
-        if (! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
49
+        if (!$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
50 50
             return redirect()->back();
51 51
         }
52 52
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
       $Callback->save();
75 75
 
76
-        Mail::send('emails.request', ['user' => $user, 'callback' => $Callback], function ($m) use ($user) {
76
+        Mail::send('emails.request', [ 'user' => $user, 'callback' => $Callback ], function($m) use ($user) {
77 77
            $m->from('[email protected]', 'Ring Me');
78 78
 
79 79
            $m->to("[email protected]", 'Glenn')->subject('Call back request!');
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $user = auth()->user();
110 110
 
111
-        if (! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
111
+        if (!$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
112 112
             return redirect()->back();
113 113
         }
114 114
 
Please login to merge, or discard this patch.
app/ProductsCategories.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/AssetsController.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,17 +8,17 @@
 block discarded – undo
8 8
 
9 9
 class AssetsController extends Controller
10 10
 {
11
-  /**
12
-   * AssetsController constructor.
13
-   */
14
-  public function __construct()
15
-  {
16
-      $this->middleware('auth');
17
-      $this->middleware('lang');
18
-  }
11
+    /**
12
+     * AssetsController constructor.
13
+     */
14
+    public function __construct()
15
+    {
16
+        $this->middleware('auth');
17
+        $this->middleware('lang');
18
+    }
19 19
 
20
-  public function index()
21
-  {
20
+    public function index()
21
+    {
22 22
     return view('assets.index');
23
-  }
23
+    }
24 24
 }
Please login to merge, or discard this patch.
app/Http/Controllers/ProductsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
 
22 22
     public function index()
23 23
     {
24
-        $data['products'] = Products::paginate(15);
25
-        $data['category'] = ProductsCategories::paginate(15);
24
+        $data[ 'products' ] = Products::paginate(15);
25
+        $data[ 'category' ] = ProductsCategories::paginate(15);
26 26
 
27 27
         return view('products.index', $data);
28 28
     }
Please login to merge, or discard this patch.