/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function vistapropiedad(Request $request)
 {
     $property_id = $request->input('property_id');
     $properties = Property::select('id', 'name', 'image', 'status', 'num_bedrooms', 'description', 'slogan', 'country_id', 'service_id', 'state_id', 'city_id', 'property_type_id', 'user_id')->with('country')->with('service')->with('state')->with('city')->with('property_type')->with('user')->orderBy('name', 'ASC')->get();
     $amenities = Amenity::select('amenity', 'category')->where('property_id', '=', $property_id)->where('category', '=', "Special amenities")->get();
     $service_a = Amenity::select('amenity', 'category')->where('property_id', '=', $property_id)->where('category', '=', "services")->get();
     $technology_a = Amenity::select('amenity', 'category')->where('property_id', '=', $property_id)->where('category', '=', "technology")->get();
     $pictures = Picture::select('image1', 'image2', 'image3', 'image4', 'image5', 'image6', 'image7', 'image8', 'image9')->where('property_id', '=', $property_id)->get();
     $files = File::select('activities')->where('property_id', '=', $property_id)->get();
     return view('vistapropiedad', compact('properties', 'property_id', 'service', 'state', 'city', 'property_type', 'user', 'user_role', 'amenity', 'slogan', 'amenities', 'amenity', 'service_a', 'technology_a', 'pictures', 'files'));
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $property_id = $id;
     $user_id = Auth::user()->id;
     $user_role = User::findOrfail($user_id);
     $count = Picture::select('id', 'property_id')->where('property_id', '=', $property_id)->count();
     $images = Picture::select('id', 'property_id')->where('property_id', '=', $property_id)->get();
     if ($count > 0) {
         return view('admin.properties.images.show', compact('user_role', 'images'));
     }
     return view('admin.properties.images.index', compact('user_role', 'property_id'));
 }