@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function store(/*RoomRequest $request*/ Request $request, $id = null) |
34 | 34 | { |
35 | - if($id === null) { |
|
35 | + if ($id === null) { |
|
36 | 36 | $object = new Room(); |
37 | 37 | } else { |
38 | 38 | try { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $object->fill($request->all()); |
49 | 49 | $object->save(); |
50 | 50 | |
51 | - return redirect()->route($this->getRouteName() . '.index') |
|
51 | + return redirect()->route($this->getRouteName().'.index') |
|
52 | 52 | ->with([ |
53 | 53 | 'message' => trans('general.saved'), |
54 | 54 | 'alert-class' => 'alert-success' |
@@ -35,9 +35,11 @@ discard block |
||
35 | 35 | if($id === null) { |
36 | 36 | $object = new Room(); |
37 | 37 | } else { |
38 | - try { |
|
38 | + try |
|
39 | + { |
|
39 | 40 | $object = Room::findOrFail($id); |
40 | - } catch (ModelNotFoundException $e) { |
|
41 | + } catch (ModelNotFoundException $e) |
|
42 | + { |
|
41 | 43 | return Controller::returnBack([ |
42 | 44 | 'message' => trans('general.object_not_found'), |
43 | 45 | 'alert-class' => 'alert-danger' |
@@ -71,9 +73,11 @@ discard block |
||
71 | 73 | $title = trans('general.add'); |
72 | 74 | $submit_route = route($this->getRouteName().'.postadd'); |
73 | 75 | } else { |
74 | - try { |
|
76 | + try |
|
77 | + { |
|
75 | 78 | $dataset = Room::findOrFail($id); |
76 | - } catch (ModelNotFoundException $e) { |
|
79 | + } catch (ModelNotFoundException $e) |
|
80 | + { |
|
77 | 81 | return Controller::returnBack([ |
78 | 82 | 'message' => trans('general.object_not_found'), |
79 | 83 | 'alert-class' => 'alert-danger', |
@@ -103,7 +107,8 @@ discard block |
||
103 | 107 | [ |
104 | 108 | 'id' => 'number', |
105 | 109 | 'title' => trans('general.number'), |
106 | - 'value' => function (Room $data) { |
|
110 | + 'value' => function (Room $data) |
|
111 | + { |
|
107 | 112 | return $data->number; |
108 | 113 | }, |
109 | 114 | 'type' => 'number', |
@@ -114,7 +119,8 @@ discard block |
||
114 | 119 | [ |
115 | 120 | 'id' => 'floor', |
116 | 121 | 'title' => trans('general.floor'), |
117 | - 'value' => function (Room $data) { |
|
122 | + 'value' => function (Room $data) |
|
123 | + { |
|
118 | 124 | return $data->floor; |
119 | 125 | }, |
120 | 126 | 'type' => 'number', |
@@ -125,7 +131,8 @@ discard block |
||
125 | 131 | [ |
126 | 132 | 'id' => 'capacity', |
127 | 133 | 'title' => trans('general.capacity'), |
128 | - 'value' => function (Room $data) { |
|
134 | + 'value' => function (Room $data) |
|
135 | + { |
|
129 | 136 | return $data->capacity; |
130 | 137 | }, |
131 | 138 | 'type' => 'number', |
@@ -136,7 +143,8 @@ discard block |
||
136 | 143 | [ |
137 | 144 | 'id' => 'price', |
138 | 145 | 'title' => trans('general.price'), |
139 | - 'value' => function (Room $data) { |
|
146 | + 'value' => function (Room $data) |
|
147 | + { |
|
140 | 148 | return $data->price; |
141 | 149 | }, |
142 | 150 | 'type' => 'number', |
@@ -149,7 +157,8 @@ discard block |
||
149 | 157 | [ |
150 | 158 | 'id' => 'comments', |
151 | 159 | 'title' => trans('general.comments'), |
152 | - 'value' => function (Room $data) { |
|
160 | + 'value' => function (Room $data) |
|
161 | + { |
|
153 | 162 | return $data->comments; |
154 | 163 | }, |
155 | 164 | 'type' => 'textarea', |
@@ -162,25 +171,29 @@ discard block |
||
162 | 171 | $dataset = [ |
163 | 172 | [ |
164 | 173 | 'title' => trans('general.number'), |
165 | - 'value' => function (Room $data) { |
|
174 | + 'value' => function (Room $data) |
|
175 | + { |
|
166 | 176 | return $data->number; |
167 | 177 | }, |
168 | 178 | ], |
169 | 179 | [ |
170 | 180 | 'title' => trans('general.floor'), |
171 | - 'value' => function (Room $data) { |
|
181 | + 'value' => function (Room $data) |
|
182 | + { |
|
172 | 183 | return $data->floor; |
173 | 184 | }, |
174 | 185 | ], |
175 | 186 | [ |
176 | 187 | 'title' => trans('general.capacity'), |
177 | - 'value' => function (Room $data) { |
|
188 | + 'value' => function (Room $data) |
|
189 | + { |
|
178 | 190 | return $data->capacity; |
179 | 191 | }, |
180 | 192 | ], |
181 | 193 | [ |
182 | 194 | 'title' => trans('general.price'), |
183 | - 'value' => function (Room $data) { |
|
195 | + 'value' => function (Room $data) |
|
196 | + { |
|
184 | 197 | return $data->price; |
185 | 198 | }, |
186 | 199 | ], |