/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (!Settings::item('page_review')) {
         abort(404);
     }
     $review = Review::where('active', 1)->orderBy('id', 'DESC')->paginate(10);
     return view('review.index', ['reviews' => $review]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (!Settings::item('page_map')) {
         abort(404);
     }
     $apartment = Apartment::active()->where('map_lat', '!=', '')->where('map_lng', '!=', '')->paginate(50);
     return view('map.index', ['apartments' => $apartment]);
 }
 public function store(ContactRequest $request)
 {
     if (!Settings::item('page_contact') or !Settings::item('contact_form')) {
         abort(404);
     }
     $data = ['name' => $request->name, 'title' => 'Laravel5: ' . $request->title, 'text' => $request->text, 'email' => $request->email, 'admin_email' => Settings::item('admin_email')];
     Mail::send('emails.contact', $data, function ($message) use($data) {
         $message->from($data['email'], $data['name']);
         $message->subject($data['title']);
         $message->to($data['admin_email']);
     });
     return back()->with(['message' => trans('front/contact.send_success')]);
 }
Esempio n. 4
0
 public static function sliderPhotoArray($text = true, $slide = true, $id = false)
 {
     $apartments = Apartment::sliderOrId($id)->active()->get();
     $currency = Settings::item('currency');
     $photos['path'] = [];
     $photos['slide'] = $slide;
     foreach ($apartments as $apartment) {
         if ($id) {
             $photos['path'] = array_pluck(self::photoArray($apartment->photos, $apartment->id), 'path');
             // show apartment page
         } else {
             $photos['path'][] = self::firstPhoto($apartment->photos, $apartment->id, false);
             // home page
         }
         if ($text) {
             $photos['text'][] = '<a href="' . Url('/apartment/' . $apartment->id) . add_slug($apartment->slug) . '">' . $apartment->street . ', ' . $apartment->house . ' <br /> ' . $apartment->price . ' ' . trans('admin/settings.main.' . $currency) . '/' . trans('front/apartment.night') . '</a>';
         }
     }
     $photos['count'] = count($photos['path']);
     return $photos;
 }