public function index() { $pages = Page::all(); $landing = Landing::where('lang', \App::getLocale())->first(); $universities = University::where('lang', \App::getLocale())->take(9)->get(); return view('pages.index', ['pages' => $pages, 'landing' => $landing, 'universities' => $universities]); }
public function __construct() { switch (\App::getLocale()) { case 'ru': $this->localeDir = 'ru.'; break; default: $this->localeDir = ''; } }
/** * Show the appropriate view depending on the slug. * * YOU MAY WANT TO MODIFY THIS * Right now it only loads some dummy views. * * @return Response */ public function page($slug) { // get the corresponding page for that slug $page = Page::findBySlugOrId($slug)->withFakes(); // if there is such a page if ($page && $page->translation_lang == \App::getLocale()) { // load the proper template return view('page_templates.' . $page->template, ['page' => $page]); } abort(404); }
public function __construct() { $this->middleware('admin'); switch (\App::getLocale()) { case 'ru': $this->localeDir = 'ru.'; break; default: $this->localeDir = ''; } }
public function question(Request $request) { $this->validate($request, ['title' => 'required|exists:auctions,title', 'question' => 'required']); if ($request->input('confirmed')) { $auction = Auction::where('title', $request->input('title'))->first(); $recipient = $auction->seller_id; $data = ['sender' => User::find(Auth::user()->id), 'message' => $request->input('question'), 'title' => $request->input('title'), 'recipient' => $recipient]; Message::ask($data); Session::flash('flash_message', trans('messages.question.sent')); return redirect(\App::getLocale() . '/art'); } else { return view('auctions.ask_conf')->with('message', $request); } }