Exemple #1
0
 /**
  * @return View
  */
 public function index()
 {
     $posts = $this->__getPosts();
     $review = $this->__getReview();
     $data = ['posts' => $posts, 'review' => $review, 'slides' => Slide::orderBy('sort', 'asc')->get(), 'histories' => HistoryDate::orderBy('order', 'asc')->get(), 'schedule_and_cost' => ScheduleAndCost::orderBy('order', 'asc')->get(), 'next_posts' => $posts->nextPageUrl()];
     return view('welcome', $data);
 }
 public function getIndex()
 {
     $slides = Slide::all();
     foreach ($slides as $slide) {
         $slide->flame = Flame::findOrFail($slide->flame_id);
     }
     return Response::json($slides);
 }
Exemple #3
0
 public function register($attr, $content = null, $name = null)
 {
     $slides = \App\Slide::orderBy('sort')->get();
     $html = '';
     foreach ($slides as $slide) {
         $html .= view('shortcode.slide', ['slide' => $slide])->render();
     }
     return $html;
 }
 public function delete(Request $request, $id)
 {
     if (Slide::destroy($id)) {
         return redirect()->action('SlidesController@index')->withMessage('Your slide has been deleted!');
     } else {
         return redirect('back')->withErrors('Something went wrong while adding your slide. Report this to the
         tech chair.');
     }
 }
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('*', function ($view) {
         if (current_lang_id() == 1) {
             $view->with('slides', \App\Slide::where('slider_id', 62)->orderBy('order', 'asc')->get());
         } else {
             $view->with('slides', \App\Slide::where('slider_id', 44)->orderBy('order', 'asc')->get());
         }
     });
 }
 public function index()
 {
     // Get events
     $upcoming = $this->getUpcomingEvents();
     // Get posts
     $posts = Post::where('category_id', '!=', 5)->latest()->take(2)->get();
     // Get slides
     $slides = Slide::all()->sortBy('priority');
     // Get featured event
     $featured = $this->getFeaturedEvent();
     return view('pages.home', compact('upcoming', 'posts', 'slides', 'featured'));
 }
 /**
  * Displays adminIndex of slides
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function adminIndex()
 {
     $slides = Slide::all()->unique('slide_set')->sortBy('slide_set');
     return view('slideset.adminIndex', ['slides' => $slides]);
 }
 /**
  * Delete a slide in the database.
  *
  * @param Slide $slide
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy(Slide $slide)
 {
     $slide->delete();
     return back();
 }
 /**
  * @param Request $request
  * @param $id
  * @param $input
  */
 public function updateSlideFields(Request $request, $id, $input)
 {
     $slide = $this->slide->find($id);
     $slide->update($input);
     $this->slideFields($request, $slide);
 }
Exemple #10
0
 public function index()
 {
     $data = ['ctslides' => Slide::where('slider_id', 45)->orderBy('order', 'desc')->get(['image', 'link']), 'news' => Category::find((int) get_setting('_slidercat'), ['id']), 'travels' => Category::find((int) get_setting('_homecat2'), ['id']), 'travel_child' => Category::where('parent', (int) get_setting('_homecat2'))->orderBy('created_at', 'desc')->take(4)->get(), 'rooms' => Category::find(59)->posts()->orderBy('created_at', 'desc')->get(), 'price_page' => Post::find(48, ['id']), 'reviews' => Comment::where('type', 'review')->orderBy('created_at', 'desc')->get()];
     //return $data['travel_child'];
     return view('index.index', $data);
 }
 public function index()
 {
     $callout = $this->homePage->find(1);
     $slides = $this->slide->where('archive', 0)->where('draft', 0)->orderby('order', 'asc')->get();
     return view('pages.home', compact('slides', 'callout'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $slide = Slide::findOrFail($id);
     try {
         File::delete(public_path() . '/uploads/slider/' . $slide->image);
         $slide->destroy($id);
     } catch (Exception $e) {
         App::abort(404);
     }
     return Redirect::route('admin.slider.show');
 }
 public function showNewsDetail($slug, $id)
 {
     $data['category'] = Category::with('SubCategory')->orderBy('created_at', 'asc')->get();
     $data['comment'] = Comment::where('news_id', $id)->get();
     $data['slider'] = Slide::orderBy('created_at', 'asc')->get();
     $data['sideslider'] = SideSlider::orderBy('created_at', 'asc')->get();
     $data['news'] = News::findOrFail($id);
     $data['partner'] = Partner::orderBy('created_at', 'asc')->get();
     $data['sideNews'] = News::orderBy('created_at', 'desc')->take(3)->skip(0)->get();
     $data['album'] = Album::orderBy('created_at', 'asc')->take(12)->skip(0)->get();
     $data['staff'] = Staff::orderBy('created_at', 'asc')->take(5)->skip(0)->get();
     if ($slug != $data['news']->slug) {
         return Redirect::route('site.show.news.detail', $data['page']->slug, $id);
     }
     return view('site.news-detail', $data);
 }
 /**
  * Presentation slide as json
  *
  * @param  Request  $request
  * @param  Response $response
  * @param  Array    $args
  * @return Response
  */
 public function json(Request $request, Response $response, array $args)
 {
     $path = $this->settings['presentation']['presentation'];
     $fileName = substr_replace($args['file'], '.', -3, 1);
     $filePath = $path . $fileName;
     $slideNumber = (int) preg_replace('/\\D/', '', $args['slide']);
     $file = new File($filePath);
     $data = [];
     if ($file->load() === true) {
         $slide = new Slide($filePath);
         $data['error'] = false;
         $data['slide'] = $slide->renderForAjax($slideNumber);
     } else {
         $data['error'] = true;
         $data['message'] = 'Could not load presentation file.';
     }
     return $response->withJson($data);
 }
Exemple #15
0
 /**
  * Display homepage
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('home.index', ["slides" => Slide::all(), "brands" => Property::where("is_brand", true)->orderBy('created_at', 'DESC')->take(7)->get(), "latests" => Property::orderBy("created_at", "DESC")->take(9)->get()]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // get all slides
     $slides = Slide::all();
     return $slides;
 }
 public function bookSave(Request $request, $book_id)
 {
     $json = $request->input('json');
     $object = json_decode($json);
     foreach ($object as $slideOrder => $slideObject) {
         $slide_id = $slideObject->id;
         $slide = Slide::where('id', $slide_id)->first();
         if ($slide) {
             $slide->order = $slideOrder;
             $slide->save();
             SlideImage::where('slide_id', $slide_id)->delete();
             foreach ($slideObject->images as $imageOrder => $image_id) {
                 $slideImage = new SlideImage();
                 $slideImage->image_id = $image_id;
                 $slideImage->slide_id = $slide_id;
                 $slideImage->order = $imageOrder;
                 $slideImage->save();
             }
         }
     }
 }