@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | 'name' => 'required|min:2|max:190|name|unique:sites,name', |
50 | 50 | ]); |
51 | 51 | |
52 | - $site = Site::create(['name' => $request->name]); |
|
52 | + $site = Site::create([ 'name' => $request->name ]); |
|
53 | 53 | |
54 | 54 | return redirect()->route('site.show', $site->id) |
55 | 55 | ->with('success', 'Site created successfully'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $locations = $site->locations()->orderBy('name', 'ASC')->paginate(15); |
68 | 68 | |
69 | 69 | if (\Request::ajax()) |
70 | - return response()->json(['site' => $site, 'locations' => $locations]); |
|
70 | + return response()->json([ 'site' => $site, 'locations' => $locations ]); |
|
71 | 71 | else |
72 | 72 | return view('site.show', [ 'site' => $site, 'locations' => $locations ]); |
73 | 73 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'name' => 'required|min:2|max:190|name|unique:sites,name,'.$site->id, |
99 | 99 | ]); |
100 | 100 | |
101 | - $site->update(['name' => $request->name]); |
|
101 | + $site->update([ 'name' => $request->name ]); |
|
102 | 102 | |
103 | 103 | return redirect()->route('site.show', $site->id) |
104 | 104 | ->with('success', 'Site updated successfully'); |
@@ -114,6 +114,6 @@ discard block |
||
114 | 114 | { |
115 | 115 | Site::findOrFail($id)->delete(); |
116 | 116 | return redirect()->route('site.index') |
117 | - ->with('success','Site deleted successfully'); |
|
117 | + ->with('success', 'Site deleted successfully'); |
|
118 | 118 | } |
119 | 119 | } |
@@ -16,19 +16,19 @@ |
||
16 | 16 | public function dataTable($query) |
17 | 17 | { |
18 | 18 | return datatables($query) |
19 | - ->editColumn('name', function ($device) { |
|
20 | - return '<a href="' . route('device.show', $device->id) . '">' . $device->name . '</a>'; |
|
19 | + ->editColumn('name', function($device) { |
|
20 | + return '<a href="'.route('device.show', $device->id).'">'.$device->name.'</a>'; |
|
21 | 21 | }) |
22 | - ->addColumn('location', function ($device) { |
|
22 | + ->addColumn('location', function($device) { |
|
23 | 23 | return ($device->location->name ?? 'null'); |
24 | 24 | }) |
25 | - ->addColumn('site', function ($device) { |
|
25 | + ->addColumn('site', function($device) { |
|
26 | 26 | return ($device->location->site->name ?? 'null'); |
27 | 27 | }) |
28 | - ->addColumn('rates', function ($device) { |
|
29 | - return $device->update_rate . '/' . $device->image_rate .'/' . $device->sensor_rate; |
|
28 | + ->addColumn('rates', function($device) { |
|
29 | + return $device->update_rate.'/'.$device->image_rate.'/'.$device->sensor_rate; |
|
30 | 30 | }) |
31 | - ->editColumn('updated_at', function ($device) { |
|
31 | + ->editColumn('updated_at', function($device) { |
|
32 | 32 | return (is_object($device->updated_at) ? $device->updatedAtHuman : 'null'); |
33 | 33 | }) |
34 | 34 | ->blacklist([ 'location', 'site', 'rates' ]) |
@@ -16,16 +16,16 @@ |
||
16 | 16 | { |
17 | 17 | return datatables($query) |
18 | 18 | ->editColumn('name', function(User $user) { |
19 | - return '<a href="' . route('user.show', $user->id) . '">'. $user->name . '</a>'; |
|
19 | + return '<a href="'.route('user.show', $user->id).'">'.$user->name.'</a>'; |
|
20 | 20 | }) |
21 | 21 | |
22 | 22 | ->editColumn('role', function(User $user) { |
23 | 23 | return $user->roleString(); |
24 | 24 | }) |
25 | - ->editColumn('updated_at', function ($user) { |
|
25 | + ->editColumn('updated_at', function($user) { |
|
26 | 26 | return $user->updatedAtHuman; |
27 | 27 | }) |
28 | - ->editColumn('created_at', function ($user) { |
|
28 | + ->editColumn('created_at', function($user) { |
|
29 | 29 | return $user->createdAtHuman; |
30 | 30 | }) |
31 | 31 | ->addColumn('action', 'user.action') |
@@ -17,30 +17,30 @@ discard block |
||
17 | 17 | public function dataTable($query) |
18 | 18 | { |
19 | 19 | return datatables($query) |
20 | - ->editColumn('causer_id', function ($activity) { |
|
20 | + ->editColumn('causer_id', function($activity) { |
|
21 | 21 | if ($activity->causer_id) { |
22 | - return '<a href="' . route($this->getRouteFromType($activity->causer_type), $activity->causer_id) . '">' . $activity->causer->name ?? '' . '</a>'; |
|
22 | + return '<a href="'.route($this->getRouteFromType($activity->causer_type), $activity->causer_id).'">'.$activity->causer->name ?? ''.'</a>'; |
|
23 | 23 | } else { |
24 | 24 | return ''; |
25 | 25 | } |
26 | 26 | }) |
27 | - ->editColumn('subject_id', function ($activity) { |
|
27 | + ->editColumn('subject_id', function($activity) { |
|
28 | 28 | if ($activity->subject_id) { |
29 | - return '<a href="' . route($this->getRouteFromType($activity->subject_type), $activity->subject_id) . '">' . $activity->subject->name ?? '' . '</a>'; |
|
29 | + return '<a href="'.route($this->getRouteFromType($activity->subject_type), $activity->subject_id).'">'.$activity->subject->name ?? ''.'</a>'; |
|
30 | 30 | } else { |
31 | 31 | return ''; |
32 | 32 | } |
33 | 33 | }) |
34 | - ->editColumn('properties', function ($activity) { |
|
34 | + ->editColumn('properties', function($activity) { |
|
35 | 35 | return $activity->properties; |
36 | 36 | }) |
37 | - ->editColumn('created_at', function ($activity) { |
|
37 | + ->editColumn('created_at', function($activity) { |
|
38 | 38 | if ($activity->created_at->diffInDays() > 0) |
39 | 39 | return $activity->created_at->setTimezone(Auth::user()->timezone)->format('M d, Y h:i a'); |
40 | 40 | else |
41 | 41 | return $activity->created_at->diffForHumans(); |
42 | 42 | }) |
43 | - ->rawColumns(['causer_id', 'subject_id', 'properties']); |
|
43 | + ->rawColumns([ 'causer_id', 'subject_id', 'properties' ]); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function getRouteFromType($type) { |
@@ -137,6 +137,6 @@ discard block |
||
137 | 137 | */ |
138 | 138 | protected function filename() |
139 | 139 | { |
140 | - return 'activitylog_' . time(); |
|
140 | + return 'activitylog_'.time(); |
|
141 | 141 | } |
142 | 142 | } |
@@ -54,10 +54,10 @@ |
||
54 | 54 | 'registration_password' => 'required|string|min:8', |
55 | 55 | ]); |
56 | 56 | |
57 | - return $validator->after(function ($validator) { |
|
57 | + return $validator->after(function($validator) { |
|
58 | 58 | if (array_key_exists('registration_password', $validator->valid())) |
59 | 59 | { |
60 | - if ($validator->valid()['registration_password'] != env('REGISTRATION_CHALLENGE', 'temppass')) { |
|
60 | + if ($validator->valid()[ 'registration_password' ] != env('REGISTRATION_CHALLENGE', 'temppass')) { |
|
61 | 61 | $validator->errors()->add('registration_password', 'Incorrect registration password.'); |
62 | 62 | } |
63 | 63 | } |