本文整理汇总了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;
}