Completed
Pull Request — master (#82)
by Glenn
02:36
created
app/Http/Controllers/ApiKeyController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers;
4 4
 
5
-use App\User;
6 5
 use Illuminate\Http\Request;
7 6
 use Chrisbjr\ApiGuard\Models\ApiKey;
8
-use App\Http\Requests;
9 7
 
10 8
 class ApiKeyController extends Controller
11 9
 {
Please login to merge, or discard this patch.
app/Http/Controllers/StaffController.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
82 82
      */
83 83
     public function index()
84
-	{
85
-		$data['users'] = User::paginate(15);
86
-    	return view('users/index', $data);
84
+    {
85
+        $data['users'] = User::paginate(15);
86
+        return view('users/index', $data);
87 87
     }
88 88
 
89 89
     /**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         $id = auth()->user()->id;
125 125
         $data['tokens'] = ApiKey::where('user_id', $id)->get();
126
-    	return view('users/profile', $data);
126
+        return view('users/profile', $data);
127 127
     }
128 128
 
129 129
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $data2 = [];
150 150
         foreach($items as $role)
151 151
         {
152
-         $data2[] = [
152
+            $data2[] = [
153 153
         'value' => $role["id"],
154 154
         'text'  => $role["name"]
155 155
         ];
Please login to merge, or discard this patch.
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.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function create()
38 38
     {
39
-        $data['departments'] = Departments::all();
39
+        $data[ 'departments' ] = Departments::all();
40 40
         return view('staff.create', $data);
41 41
     }
42 42
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function store(Requests\NewStaffValidator $input)
52 52
     {
53
-        $newUser = User::create($input->except(['_token', 'department']))->id;
53
+        $newUser = User::create($input->except([ '_token', 'department' ]))->id;
54 54
         User::find($newUser)->departments()->attach($input->department);
55 55
 
56 56
         session()->flash('message', 'New staff member created');
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function edit($id)
80 80
     {
81
-        $data['query'] = User::find($id);
81
+        $data[ 'query' ] = User::find($id);
82 82
         return view('staff.edit', $data);
83 83
     }
84 84
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function index()
91 91
 	{
92
-		$data['users'] = User::paginate(15);
92
+		$data[ 'users' ] = User::paginate(15);
93 93
     	return view('users/index', $data);
94 94
     }
95 95
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     public function profile()
130 130
     {
131 131
         $id = auth()->user()->id;
132
-        $data['tokens'] = ApiKey::where('user_id', $id)->get();
132
+        $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get();
133 133
     	return view('users/profile', $data);
134 134
     }
135 135
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function destroy($id)
143 143
     {
144 144
         $user = User::find($id);
145
-        $user->roles()->sync([]);
145
+        $user->roles()->sync([ ]);
146 146
 
147 147
         User::destroy($id);
148 148
         session()->flash('message', 'User deleted');
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
     public function get_roles()
154 154
     {
155 155
         $items = Roles::all();
156
-        $data2 = [];
157
-        foreach($items as $role)
156
+        $data2 = [ ];
157
+        foreach ($items as $role)
158 158
         {
159
-         $data2[] = [
160
-        'value' => $role["id"],
161
-        'text'  => $role["name"]
159
+         $data2[ ] = [
160
+        'value' => $role[ "id" ],
161
+        'text'  => $role[ "name" ]
162 162
         ];
163 163
 
164 164
         }
Please login to merge, or discard this patch.
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/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.