Completed
Pull Request — master (#91)
by Glenn
02:55
created
app/Http/Controllers/ProfileController.php 2 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.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
     public function updateProfile(Requests\ProfileValidator $input)
30 30
     {
31 31
         // User information
32
-        User::find(auth()->user()->id)->update($input->except(['_token', 'avatar']));
32
+        User::find(auth()->user()->id)->update($input->except([ '_token', 'avatar' ]));
33 33
 
34 34
         // User image information.
35 35
         if (Input::file()) {
36 36
             $image    = Input::file('avatar');
37
-            $filename = time() . '.' . $image->getClientOriginalExtension();
38
-            $path     = public_path('profilepics/' . $filename);
37
+            $filename = time().'.'.$image->getClientOriginalExtension();
38
+            $path     = public_path('profilepics/'.$filename);
39 39
             
40 40
             Image::make($image->getRealPath())->resize(80, 80)->save($path);
41 41
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function updateSecurity(Requests\PasswordValidation $input)
58 58
     {
59
-        $data['password'] = bcrypt($input->password);
59
+        $data[ 'password' ] = bcrypt($input->password);
60 60
 
61 61
         User::find(auth()->user()->id)->update($data);
62 62
         session()->flash('message', 'Your password has been updated.');
Please login to merge, or discard this patch.
app/Http/Requests/PasswordValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
      */
27 27
     public function rules()
28 28
     {
29
-        return ['password' => 'required|min:6|confirmed'];
29
+        return [ 'password' => 'required|min:6|confirmed' ];
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
app/Departments.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class Departments extends Model
8 8
 {
9
-    protected $fillable = ['name', 'manager'];
9
+    protected $fillable = [ 'name', 'manager' ];
10 10
 
11 11
     /**
12 12
      * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
Please login to merge, or discard this patch.
app/Http/Controllers/StaffController.php 3 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   +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   +16 added lines, -16 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
 
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $user = auth()->user();
59 59
 
60
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
60
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
61 61
             return redirect()->back();
62 62
         }
63 63
 
64
-        $newUser = User::create($input->except(['_token', 'department']))->id;
64
+        $newUser = User::create($input->except([ '_token', 'department' ]))->id;
65 65
         User::find($newUser)->departments()->attach($input->department);
66 66
 
67 67
         session()->flash('message', 'New staff member created');
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $user = auth()->user();
82 82
 
83
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
83
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
84 84
             return redirect()->back();
85 85
         }
86 86
 
87
-        User::find($id)-update($input->except('_token'));
87
+        User::find($id) - update($input->except('_token'));
88 88
         session()->flash('message', 'Staff member has been updated');
89 89
         return redirect()->back(302);
90 90
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     public function edit($id)
99 99
     {
100
-        $data['query'] = User::find($id);
100
+        $data[ 'query' ] = User::find($id);
101 101
         return view('staff.edit', $data);
102 102
     }
103 103
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function index()
110 110
 	{
111
-        $data["departments"] = Departments::all();
112
-		$data['users'] = User::paginate(15);
111
+        $data[ "departments" ] = Departments::all();
112
+		$data[ 'users' ] = User::paginate(15);
113 113
     	return view('users/index', $data);
114 114
     }
115 115
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public function profile()
150 150
     {
151 151
         $id = auth()->user()->id;
152
-        $data['tokens'] = ApiKey::where('user_id', $id)->get();
152
+        $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get();
153 153
     	return view('users/profile', $data);
154 154
     }
155 155
 
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
     {
164 164
         $user = auth()->user();
165 165
 
166
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
166
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
167 167
             return redirect()->back();
168 168
         }
169 169
 
170 170
         $user = User::find($id);
171
-        $user->roles()->sync([]);
171
+        $user->roles()->sync([ ]);
172 172
 
173 173
         User::destroy($id);
174 174
         session()->flash('message', 'User deleted');
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
     public function get_roles()
180 180
     {
181 181
         $items = Roles::all();
182
-        $data2 = [];
183
-        foreach($items as $role)
182
+        $data2 = [ ];
183
+        foreach ($items as $role)
184 184
         {
185
-         $data2[] = [
186
-        'value' => $role["id"],
187
-        'text'  => $role["name"]
185
+         $data2[ ] = [
186
+        'value' => $role[ "id" ],
187
+        'text'  => $role[ "name" ]
188 188
         ];
189 189
 
190 190
         }
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.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function index()
17 17
     {
18
-    	$data['roles'] = Roles::all();
18
+    	$data[ 'roles' ] = Roles::all();
19 19
     	return view('roles.index', $data);
20 20
     }
21 21
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function search(Request $request)
29 29
     {
30 30
         $term = $request->get('term');
31
-        $data['roles'] = Roles::where('name', 'LIKE', "$term")->get();
31
+        $data[ 'roles' ] = Roles::where('name', 'LIKE', "$term")->get();
32 32
         return view('roles.index', $data);
33 33
     }
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function show($id)
42 42
     {
43
-        $data['query'] = Roles::find($id);
43
+        $data[ 'query' ] = Roles::find($id);
44 44
         return view('', $data);
45 45
     }
46 46
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function edit($id)
73 73
     {
74
-        $data['query'] = Roles::find($id);
74
+        $data[ 'query' ] = Roles::find($id);
75 75
         return view('', $data)
76 76
     }
77 77
 
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.
app/Http/Controllers/WelcomeController.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers;
4 4
 
5
-use Illuminate\Http\Request;
6
-use App\Http\Requests;
7
-
8 5
 use App\Roles;
9 6
 
10 7
 class RolesController extends Controller
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
      */
26 26
     public function index()
27 27
     {
28
-        $data["department"] = Departments::all();
29
-        $data["agents"] = User::all();
28
+        $data[ "department" ] = Departments::all();
29
+        $data[ "agents" ] = User::all();
30 30
         return view('welcome', $data);
31 31
     }
32 32
 }
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.