Completed
Pull Request — master (#91)
by Tim
03:51
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   +15 added lines, -15 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');
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $user = auth()->user();
81 81
 
82
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
82
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
83 83
             return redirect()->back();
84 84
         }
85 85
 
86
-        User::find($id)-update($input->except('_token'));
86
+        User::find($id) - update($input->except('_token'));
87 87
         session()->flash('message', 'Staff member has been updated');
88 88
         return redirect()->back(302);
89 89
     }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function edit($id)
98 98
     {
99
-        $data['query'] = User::find($id);
99
+        $data[ 'query' ] = User::find($id);
100 100
         return view('staff.edit', $data);
101 101
     }
102 102
 
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function index()
109 109
 	{
110
-        $data["departments"] = Departments::all();
111
-		$data['users'] = User::paginate(15);
110
+        $data[ "departments" ] = Departments::all();
111
+		$data[ 'users' ] = User::paginate(15);
112 112
     	return view('users/index', $data);
113 113
     }
114 114
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     public function profile()
149 149
     {
150 150
         $id = auth()->user()->id;
151
-        $data['tokens'] = ApiKey::where('user_id', $id)->get();
151
+        $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get();
152 152
     	return view('users/profile', $data);
153 153
     }
154 154
 
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $user = auth()->user();
164 164
 
165
-        if (! $user->is('Manager') || ! $user->is('Administrator')) {
165
+        if (!$user->is('Manager') || !$user->is('Administrator')) {
166 166
             return redirect()->back();
167 167
         }
168 168
 
169 169
         $user = User::find($id);
170
-        $user->roles()->sync([]);
170
+        $user->roles()->sync([ ]);
171 171
 
172 172
         User::destroy($id);
173 173
         session()->flash('message', 'User deleted');
@@ -178,12 +178,12 @@  discard block
 block discarded – undo
178 178
     public function get_roles()
179 179
     {
180 180
         $items = Roles::all();
181
-        $data2 = [];
182
-        foreach($items as $role)
181
+        $data2 = [ ];
182
+        foreach ($items as $role)
183 183
         {
184
-         $data2[] = [
185
-        'value' => $role["id"],
186
-        'text'  => $role["name"]
184
+         $data2[ ] = [
185
+        'value' => $role[ "id" ],
186
+        'text'  => $role[ "name" ]
187 187
         ];
188 188
 
189 189
         }
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/CallbackController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public function index()
32 32
     {
33 33
         $data['query'] = Callback::all();
34
-    	return view('callbacks/list', $data);
34
+        return view('callbacks/list', $data);
35 35
     }
36 36
 
37 37
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function index()
32 32
     {
33
-        $data['query'] = Callback::all();
33
+        $data[ 'query' ] = Callback::all();
34 34
     	return view('callbacks/list', $data);
35 35
     }
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $user = auth()->user();
46 46
 
47
-        if (! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
47
+        if (!$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
48 48
             return redirect()->back();
49 49
         }
50 50
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $user = auth()->user();
62 62
 
63
-        if (! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
63
+        if (!$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
64 64
             return redirect()->back();
65 65
         }
66 66
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $user = auth()->user();
96 96
 
97
-        if (! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) {
97
+        if (!$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) {
98 98
             return redirect()->back();
99 99
         }
100 100
 
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.