本文整理匯總了PHP中app\models\Menu::with方法的典型用法代碼示例。如果您正苦於以下問題:PHP Menu::with方法的具體用法?PHP Menu::with怎麽用?PHP Menu::with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Menu
的用法示例。
在下文中一共展示了Menu::with方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* 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;
}
示例2: __construct
/**
* 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();
}
示例3: index
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);
}
示例4: compose
/**
* 將數據綁定到視圖。
*
* @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);
}
示例5: getData
/**
* @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;
}