public function search($input) { $query = ReserveRoom::query(); $columns = Schema::getColumnListing('reserveRooms'); $attributes = array(); foreach ($columns as $attribute) { if (isset($input[$attribute]) and !empty($input[$attribute])) { $query->where($attribute, $input[$attribute]); $attributes[$attribute] = $input[$attribute]; } else { $attributes[$attribute] = null; } } return [$query->get(), $attributes]; }
public function removeRoom($id) { ReserveRoom::destroy($id); }
public function detail($id) { $rr = ReserveRoom::find($id); return response()->json($rr); }