Completed
Pull Request — master (#91)
by Tim
02:31
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
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $user = auth()->user();
40 40
 
41
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
41
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
42 42
             return redirect()->back();
43 43
         }
44 44
 
45
-        $data['departments'] = Departments::all();
45
+        $data[ 'departments' ] = Departments::all();
46 46
         return view('staff.create', $data);
47 47
     }
48 48
 
@@ -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,7 +80,7 @@  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
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function edit($id)
97 97
     {
98
-        $data['query'] = User::find($id);
98
+        $data[ 'query' ] = User::find($id);
99 99
         return view('staff.edit', $data);
100 100
     }
101 101
 
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function index()
108 108
 	{
109
-        $data["departments"] = Departments::all();
110
-		$data['users'] = User::paginate(15);
109
+        $data[ "departments" ] = Departments::all();
110
+		$data[ 'users' ] = User::paginate(15);
111 111
     	return view('users/index', $data);
112 112
     }
113 113
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     public function profile()
148 148
     {
149 149
         $id = auth()->user()->id;
150
-        $data['tokens'] = ApiKey::where('user_id', $id)->get();
150
+        $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get();
151 151
     	return view('users/profile', $data);
152 152
     }
153 153
 
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
     {
162 162
         $user = auth()->user();
163 163
 
164
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
164
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
165 165
             return redirect()->back();
166 166
         }
167 167
 
168 168
         $user = User::find($id);
169
-        $user->roles()->sync([]);
169
+        $user->roles()->sync([ ]);
170 170
 
171 171
         User::destroy($id);
172 172
         session()->flash('message', 'User deleted');
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
     public function get_roles()
178 178
     {
179 179
         $items = Roles::all();
180
-        $data2 = [];
181
-        foreach($items as $role)
180
+        $data2 = [ ];
181
+        foreach ($items as $role)
182 182
         {
183
-         $data2[] = [
184
-        'value' => $role["id"],
185
-        'text'  => $role["name"]
183
+         $data2[ ] = [
184
+        'value' => $role[ "id" ],
185
+        'text'  => $role[ "name" ]
186 186
         ];
187 187
 
188 188
         }
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/BackupController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 class BackupController extends Controller
10 10
 {
11
-	    public function __construct()
11
+        public function __construct()
12 12
     {
13 13
         $this->middleware('auth');
14 14
         $this->middleware('lang');
@@ -21,6 +21,6 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function index()
23 23
     {
24
-    	return view('settings.backups');
24
+        return view('settings.backups');
25 25
     }
26 26
 }
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.