/** * Display a listing of the resource. * * @return Response */ public function __construct() { $setting = Models\Setting::first(); $this->data['menu'] = Models\Menu::with('child')->where('level', 0)->get(); $this->data['berita'] = Models\Berita::orderBy('id_berita', 'desc')->limit(6)->get(); $this->data['pengumuman'] = Models\Pengumuman::orderBy('tanggal', 'desc')->limit(10)->get(); $this->data['agenda'] = Models\Agenda::orderBy('tgl_posting', 'desc')->limit(5)->get(); $this->data['polling'] = Models\Polling::with('jawaban')->where('status', 'Y')->limit(1)->first(); $this->data['title'] = $setting->title_web; $this->data['desc'] = $setting->desc_web; $this->data['key'] = $setting->key_web; $this->data['logo'] = $setting->logo; $this->data['header_img'] = $setting->bg_header; $this->data['icon'] = $setting->favicon; $this->data['facebook'] = $setting->facebook; $this->data['peta_latitude'] = $setting->peta_latitude; $this->data['peta_longitude'] = $setting->peta_longitude; $this->data['twitter'] = $setting->twitter; $this->data['gplus'] = $setting->gplus; $this->data['slider_home'] = Models\Berita::orderBy('tanggal', 'desc')->limit(5)->get(); $this->data['galeri_home'] = Models\Foto::OrderBy('id_foto', 'desc')->paginate(9); $this->data['opini_home'] = Models\Berita::where('kategori_berita', 5)->orderBy('id_berita', 'desc')->limit(6)->get(); $this->data['banner'] = Models\Banner::where('id', 1)->first(); $this->data['link'] = Models\Link::orderBy('id', 'desc')->limit(5)->get(); $this->data['publikasi'] = Models\Publikasi::orderBy('id', 'desc')->limit(3)->get(); $this->data['setting'] = $setting; }
/** * Display a listing of the resource. * * @return Response */ public function __construct() { $this->data['menu'] = Models\Menu::with('child')->where('level', 0)->get(); $this->data['berita'] = Models\Berita::orderBy('tanggal', 'desc')->limit(4)->get(); $this->data['pengumuman'] = Models\Pengumuman::orderBy('tanggal', 'desc')->limit(5)->get(); $this->data['agenda'] = Models\Agenda::orderBy('tgl_posting', 'desc')->limit(5)->get(); $this->data['polling'] = Models\Polling::with('jawaban')->where('status', 'Y')->limit(1)->first(); }
public function index() { //Get Menu Lists if ($this->auth->check()) { $status = "logined"; } else { $status = "unlogin"; } $this->login = $status; $menu = Menu::with('SubMenu')->get(); return response()->json($menu); }
/** * 将数据绑定到视图。 * * @param View $view * @return void */ public function compose(View $view) { //查询当前登录用户 $currentRoute = Route::currentRouteName(); $list = explode('.', $currentRoute); $route = ''; for ($i = 0; $i < count($list) - 1; $i++) { if ($i == 0) { $route .= $list[$i]; } else { $route .= '.' . $list[$i]; } } $route = $route . '.index'; $breadcrumb = Menu::with('parent')->where('fun_route_name', $route)->first(); $view->with('breadcrumb', $breadcrumb); }
/** * @param Request $request * * @return mixed */ public function getData(Request $request) { $id = $request->input('id'); $menuItem = Menu::with('route')->with('permission')->with('parent')->find($id); return $menuItem; }