@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | 'name' => 'required|min:2|max:75|regex:#(^[a-zA-Z0-9])([\w ]*)(\w$)#|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:75|regex:#(^[a-zA-Z0-9])([\w ]*)(\w$)#|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 | } |