@@ -63,9 +63,9 @@ |
||
| 63 | 63 | protected function create(array $data) |
| 64 | 64 | { |
| 65 | 65 | return User::create([ |
| 66 | - 'name' => $data['name'], |
|
| 67 | - 'email' => $data['email'], |
|
| 68 | - 'password' => bcrypt($data['password']), |
|
| 66 | + 'name' => $data[ 'name' ], |
|
| 67 | + 'email' => $data[ 'email' ], |
|
| 68 | + 'password' => bcrypt($data[ 'password' ]), |
|
| 69 | 69 | ]); |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct() |
| 36 | 36 | { |
| 37 | - $this->middleware('guest', ['except' => 'logout']); |
|
| 37 | + $this->middleware('guest', [ 'except' => 'logout' ]); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | protected function unauthenticated($request, AuthenticationException $exception) |
| 58 | 58 | { |
| 59 | 59 | if ($request->expectsJson()) { |
| 60 | - return response()->json(['error' => 'Unauthenticated.'], 401); |
|
| 60 | + return response()->json([ 'error' => 'Unauthenticated.' ], 401); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | return redirect()->guest(route('login')); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function via($notifiable) |
| 31 | 31 | { |
| 32 | - return ['nexmo']; |
|
| 32 | + return [ 'nexmo' ]; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | 31 | Validator::replacer('phone', function($message, $attribute, $rule, $parameters) { |
| 32 | - return str_replace(':attribute',$attribute, ':attribute is invalid phone number'); |
|
| 32 | + return str_replace(':attribute', $attribute, ':attribute is invalid phone number'); |
|
| 33 | 33 | }); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $user = User::findOrFail($id); |
| 91 | 91 | $user->password = ""; |
| 92 | 92 | |
| 93 | - return view('user.show', ['user' => $user]); |
|
| 93 | + return view('user.show', [ 'user' => $user ]); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $user = User::findOrFail($id); |
| 106 | 106 | $user->password = ""; |
| 107 | 107 | |
| 108 | - return view('user.edit', ['user' => $user]); |
|
| 108 | + return view('user.edit', [ 'user' => $user ]); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -179,6 +179,6 @@ discard block |
||
| 179 | 179 | $user = User::findOrFail($id); |
| 180 | 180 | $user->password = ""; |
| 181 | 181 | |
| 182 | - return view('user.remove', ['user' => $user]); |
|
| 182 | + return view('user.remove', [ 'user' => $user ]); |
|
| 183 | 183 | } |
| 184 | 184 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $device = Device::findOrFail($id); |
| 56 | 56 | |
| 57 | - return view('device.show', ['device' => $device]); |
|
| 57 | + return view('device.show', [ 'device' => $device ]); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | else |
| 74 | 74 | $site = null; |
| 75 | 75 | |
| 76 | - return view('device.edit', ['device' => $device, 'location' => $location, 'site' => $site]); |
|
| 76 | + return view('device.edit', [ 'device' => $device, 'location' => $location, 'site' => $site ]); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | { |
| 184 | 184 | $device = Device::findOrFail($id); |
| 185 | 185 | |
| 186 | - return view('device.remove', ['device' => $device]); |
|
| 186 | + return view('device.remove', [ 'device' => $device ]); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -68,10 +68,11 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | $device = Device::findOrFail($id); |
| 70 | 70 | $location = Location::where('id', $device->location_id)->first(); |
| 71 | - if ($location) |
|
| 72 | - $site = Site::where('id', $location->site_id)->first(); |
|
| 73 | - else |
|
| 74 | - $site = null; |
|
| 71 | + if ($location) { |
|
| 72 | + $site = Site::where('id', $location->site_id)->first(); |
|
| 73 | + } else { |
|
| 74 | + $site = null; |
|
| 75 | + } |
|
| 75 | 76 | |
| 76 | 77 | return view('device.edit', ['device' => $device, 'location' => $location, 'site' => $site]); |
| 77 | 78 | } |
@@ -155,8 +156,7 @@ discard block |
||
| 155 | 156 | { |
| 156 | 157 | // if the user was already deleted then permananetly delete it |
| 157 | 158 | Device::destroy($id); |
| 158 | - } |
|
| 159 | - else |
|
| 159 | + } else |
|
| 160 | 160 | { |
| 161 | 161 | //Remove the location from the device |
| 162 | 162 | $oldLocation_id = $device->location_id; |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | return $this->datatables |
| 18 | 18 | ->eloquent($this->query()) |
| 19 | 19 | ->addColumn('action', 'device.action') |
| 20 | - ->blacklist(['action']) |
|
| 21 | - ->setRowClass(function ($device) { |
|
| 20 | + ->blacklist([ 'action' ]) |
|
| 21 | + ->setRowClass(function($device) { |
|
| 22 | 22 | return $device->trashed() ? 'alert-danger' : ""; |
| 23 | 23 | }); |
| 24 | 24 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | //->addAction(['width' => '160px']) |
| 58 | 58 | ->parameters([ |
| 59 | 59 | 'dom' => 'Bfrtip', |
| 60 | - 'order' => [[0, 'asc']], |
|
| 60 | + 'order' => [ [ 0, 'asc' ] ], |
|
| 61 | 61 | 'buttons' => [ |
| 62 | 62 | 'export', |
| 63 | 63 | 'print', |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'name', |
| 84 | 84 | 'location', |
| 85 | 85 | 'site', |
| 86 | - ['name' => 'action', 'data' => 'action', 'title' => 'Actions', 'render' => null, 'searchable' => false, 'orderable' => false, 'exportable' => false, 'printable' => true, 'footer' => ''], |
|
| 86 | + [ 'name' => 'action', 'data' => 'action', 'title' => 'Actions', 'render' => null, 'searchable' => false, 'orderable' => false, 'exportable' => false, 'printable' => true, 'footer' => '' ], |
|
| 87 | 87 | ]; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -94,6 +94,6 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | protected function filename() |
| 96 | 96 | { |
| 97 | - return 'devices_' . time(); |
|
| 97 | + return 'devices_'.time(); |
|
| 98 | 98 | } |
| 99 | 99 | } |
@@ -17,19 +17,19 @@ discard block |
||
| 17 | 17 | return $this->datatables |
| 18 | 18 | ->eloquent($this->query()) |
| 19 | 19 | ->addColumn('action', 'user.action') |
| 20 | - ->blacklist(['action']) |
|
| 20 | + ->blacklist([ 'action' ]) |
|
| 21 | 21 | ->editColumn('role', function(User $user) { |
| 22 | 22 | $role_en = array(0 => "Registered", 1 => "User", 2 => "Manager", 3 => "Admin"); |
| 23 | - return $role_en[$user->role].' ('.$user->role.')';}) |
|
| 24 | - ->setRowClass(function ($user) { |
|
| 23 | + return $role_en[ $user->role ].' ('.$user->role.')'; }) |
|
| 24 | + ->setRowClass(function($user) { |
|
| 25 | 25 | return $user->trashed() ? 'alert-danger' : ""; |
| 26 | 26 | }) |
| 27 | 27 | ->setRowData([ |
| 28 | 28 | 'data-id' => function($user) { |
| 29 | - return 'row-' . $user->id; |
|
| 29 | + return 'row-'.$user->id; |
|
| 30 | 30 | }, |
| 31 | 31 | 'data-name' => function($user) { |
| 32 | - return 'row-' . $user->name; |
|
| 32 | + return 'row-'.$user->name; |
|
| 33 | 33 | }, |
| 34 | 34 | ]); |
| 35 | 35 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | //->addAction(['width' => '160px']) |
| 59 | 59 | ->parameters([ |
| 60 | 60 | 'dom' => 'Bfrtip', |
| 61 | - 'order' => [[0, 'asc']], |
|
| 61 | + 'order' => [ [ 0, 'asc' ] ], |
|
| 62 | 62 | 'buttons' => [ |
| 63 | 63 | 'create', |
| 64 | 64 | 'export', |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'role', |
| 89 | 89 | 'created_at', |
| 90 | 90 | 'updated_at', |
| 91 | - ['name' => 'action', 'data' => 'action', 'title' => 'Actions', 'render' => null, 'searchable' => false, 'orderable' => false, 'exportable' => false, 'printable' => true, 'footer' => ''], |
|
| 91 | + [ 'name' => 'action', 'data' => 'action', 'title' => 'Actions', 'render' => null, 'searchable' => false, 'orderable' => false, 'exportable' => false, 'printable' => true, 'footer' => '' ], |
|
| 92 | 92 | ]; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -99,6 +99,6 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | protected function filename() |
| 101 | 101 | { |
| 102 | - return 'users_' . time(); |
|
| 102 | + return 'users_'.time(); |
|
| 103 | 103 | } |
| 104 | 104 | } |