/** * @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 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; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $data['slider'] = Slide::orderBy('created_at', 'desc')->get(); return view('admin.slide', $data); }
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); }