@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @var array |
| 31 | 31 | */ |
| 32 | - protected $hidden = ['token']; |
|
| 32 | + protected $hidden = [ 'token' ]; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * The attributes that are mass assignable. |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected static $ignoreChangedAttributes = ['updated_at', 'last_network_update_at']; |
|
| 51 | + protected static $ignoreChangedAttributes = [ 'updated_at', 'last_network_update_at' ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * The attributes to log in the Activity Log |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function getSiteAttribute() |
| 91 | 91 | { |
| 92 | - return $this->location->site ?? (object)[]; |
|
| 92 | + return $this->location->site ?? (object) [ ]; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function getOpenTimeHumanAttribute() |
| 121 | 121 | { |
| 122 | - $time = new Carbon($this->attributes['open_time'], 'UTC'); |
|
| 122 | + $time = new Carbon($this->attributes[ 'open_time' ], 'UTC'); |
|
| 123 | 123 | $time = $time->setTimezone(Auth::user()->timezone); |
| 124 | 124 | |
| 125 | 125 | return $time->format('h:i a'); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function getCloseTimeHumanAttribute() |
| 154 | 154 | { |
| 155 | - $time = new Carbon($this->attributes['close_time'], 'UTC'); |
|
| 155 | + $time = new Carbon($this->attributes[ 'close_time' ], 'UTC'); |
|
| 156 | 156 | $time = $time->setTimezone(Auth::user()->timezone); |
| 157 | 157 | |
| 158 | 158 | return $time->format('h:i a'); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | else |
| 178 | 178 | $time = new Carbon($value, 'UTC'); |
| 179 | 179 | |
| 180 | - $this->attributes['open_time'] = $time->format('H:i:s'); |
|
| 180 | + $this->attributes[ 'open_time' ] = $time->format('H:i:s'); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | else |
| 200 | 200 | $time = new Carbon($value, 'UTC'); |
| 201 | 201 | |
| 202 | - $this->attributes['close_time'] = $time->format('H:i:s'); |
|
| 202 | + $this->attributes[ 'close_time' ] = $time->format('H:i:s'); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $isClosed = $this->cover_status === 'closed'; |
| 372 | 372 | $isLocked = $this->cover_status === 'locked'; |
| 373 | 373 | |
| 374 | - switch ($this['cover_command']) |
|
| 374 | + switch ($this[ 'cover_command' ]) |
|
| 375 | 375 | { |
| 376 | 376 | case 'open': |
| 377 | 377 | if ($isOpen) |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $validator = parent::getValidatorInstance(); |
| 40 | 40 | |
| 41 | - $validator->sometimes('site', 'integer|digits_between:1,10|exists:sites,id', function ($input) { |
|
| 41 | + $validator->sometimes('site', 'integer|digits_between:1,10|exists:sites,id', function($input) { |
|
| 42 | 42 | return !$input->new_site_name && $input->site; |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - $validator->sometimes('new_site_name', 'bail|min:2|max:190|name|unique:sites,name', function ($input) { |
|
| 45 | + $validator->sometimes('new_site_name', 'bail|min:2|max:190|name|unique:sites,name', function($input) { |
|
| 46 | 46 | return !$input->site; |
| 47 | 47 | }); |
| 48 | 48 | |
@@ -46,19 +46,19 @@ |
||
| 46 | 46 | { |
| 47 | 47 | $validator = parent::getValidatorInstance(); |
| 48 | 48 | |
| 49 | - $validator->sometimes('site_id', 'bail|integer|digits_between:1,10|exists:sites,id', function ($input) { |
|
| 49 | + $validator->sometimes('site_id', 'bail|integer|digits_between:1,10|exists:sites,id', function($input) { |
|
| 50 | 50 | return !$input->new_site_name && $input->site_id; |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | - $validator->sometimes('location_id', 'bail|integer|digits_between:1,10|exists:locations,id', function ($input) { |
|
| 53 | + $validator->sometimes('location_id', 'bail|integer|digits_between:1,10|exists:locations,id', function($input) { |
|
| 54 | 54 | return !$input->new_location_name && $input->location_id; |
| 55 | 55 | }); |
| 56 | 56 | |
| 57 | - $validator->sometimes('new_site_name', 'bail|min:2|max:190|name|unique:sites,name', function ($input) { |
|
| 57 | + $validator->sometimes('new_site_name', 'bail|min:2|max:190|name|unique:sites,name', function($input) { |
|
| 58 | 58 | return !$input->site_id && $input->name; |
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | - $validator->sometimes('new_location_name', 'bail|min:2|max:190|name|unique:locations,name', function ($input) { |
|
| 61 | + $validator->sometimes('new_location_name', 'bail|min:2|max:190|name|unique:locations,name', function($input) { |
|
| 62 | 62 | return !$input->location_id && $input->name; |
| 63 | 63 | }); |
| 64 | 64 | |
@@ -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 | } |