/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $policy = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 1)->firstOrFail(); return view('privacypolicy', compact('policy')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Get static page $offshore_dev = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 3)->firstOrFail(); $laboratory = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 4)->firstOrFail(); $package = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 5)->firstOrFail(); return view('offshore-development', compact('offshore_dev', 'laboratory', 'package')); }
public function index(Router $router) { // $routeCollection = $router->getRoutes(); // foreach ($routeCollection as $value) { // echo $value->getPath().'<br>'; // } // dd(); dd(Module::select(['name', 'route_key'])->get()->toArray()); $title = 'Dashboard'; $users = User::count(); $static_page = StaticPage::count(); $services = Service::count(); $members = Member::count(); $contacts = Contact::count(); return view('admin.dashboard.index', compact('title', 'users', 'static_page', 'services', 'members', 'contacts')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Get history $list_histories = Timeline::with(['timelineDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->orderBy('order', 'asc')->get(); $about_service = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 7)->firstOrFail(); $why_vietnam = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 8)->firstOrFail(); $message_ceo = StaticPage::with(['pageDetails' => function ($query) { $query->where('language_code', '=', App::getLocale()); }])->where('properties', '=', 9)->firstOrFail(); return view('about', compact('list_histories', 'about_service', 'why_vietnam', 'message_ceo')); }
/** * Get the option select static page. * * @return String option format for select box */ public function selectBoxPage($select_id = '') { $str_return = ''; $list_page = StaticPage::with(['PageData' => function ($query) { $query->where('language_code', '=', AppLanguage::getDefaultLanguage()); }])->where('is_active', '=', '1')->get(); if ($list_page) { foreach ($list_page as $page) { foreach ($page->PageData as $info_page) { $page_id = $page->id; if ($page_id == $select_id) { $attribute_option = 'selected'; } else { $attribute_option = ''; } $str_return .= "<option value='" . $page_id . "' " . $attribute_option . '>' . $info_page->page_title . '</option>'; } } } return $str_return; }
/** * Remove the specified resource from storage. * * @param int $id * * @return \Illuminate\Http\Response */ public function delete(Request $request) { $page_id = $request->route('staticpage'); $page_data = StaticPageData::where('static_page_id', '=', $page_id)->delete(); $page = StaticPage::find($page_id); $results = $page->delete(); if ($results) { return redirect()->route('cpanel.staticpage.index')->with('status', 'success')->with('msg', 'Successfully !'); } else { return redirect()->route('cpanel.staticpage.index')->with('status', 'fail')->with('msg', 'Can not delete.'); } }