示例#1
0
 /**
  * [landscape description]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function landscape($id)
 {
     $tours = Tour::getTourByLandScape($id);
     foreach ($tours as $key => $value) {
         $tours[$key]->periodNature = HomeController::periodNature($value->period);
     }
     $destinationsData = Destination::all();
     $departuresData = Departure::all();
     $landScapeAbroad = Tour::getLandScapeAbroad();
     $landScapeNotAbroad = Tour::getLandScapeNotAbroad();
     return view('home.searchtour', compact('tours', 'destinationsData', 'departuresData', 'landScapeAbroad', 'landScapeNotAbroad'));
 }
示例#2
0
 /**
  * [tour description]
  * @return [type] [description]
  */
 public function tour()
 {
     $featuretours = Tour::getFeatureTour();
     foreach ($featuretours as $key => $value) {
         $featuretours[$key]->periodNature = HomeController::periodNature($value->period);
     }
     $newtours = Tour::getNewTour();
     foreach ($newtours as $key => $value) {
         $newtours[$key]->periodNature = HomeController::periodNature($value->period);
     }
     $destinations = Destination::all();
     $departures = Departure::all();
     return view('home.tour', compact('featuretours', 'newtours', 'destinations', 'departures'));
 }
示例#3
0
 /**
  * [getDetailAndInfoAround description]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public static function getDetailAndInfoAround($id)
 {
     $tour = Tour::find($id);
     $tour->departure = Departure::find($tour->departure_id);
     $tour_relevant = DB::table('tours')->where('departure_id', $tour->departure_id)->take(4)->get();
     foreach ($tour_relevant as $key => $value) {
         $image = TourImage::where('tour_id', $value->id)->first();
         $tour_relevant[$key]->image = $image;
         $tour_relevant[$key]->periodNature = HomeController::periodNature($value->period);
     }
     $tour->tour_relevant = $tour_relevant;
     $tour->destinations = DB::table('destinations')->join('tour_destinations', 'destinations.id', '=', 'tour_destinations.destination_id')->where('tour_destinations.tour_id', $id)->get();
     return $tour;
 }