当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::count方法代码示例

本文整理汇总了PHP中app\Page::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::count方法的具体用法?PHP Page::count怎么用?PHP Page::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Page的用法示例。


在下文中一共展示了Page::count方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $userCount = User::count();
     $pagesCount = Page::count();
     $newsCount = News::count();
     return view('util.index', compact('userCount', 'pagesCount', 'newsCount'));
 }
开发者ID:vowsdesrat,项目名称:laravel,代码行数:12,代码来源:AuthExtendedController.php

示例2: index

 /**
  * Display the dashboard once the user is logged
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $nb_users = User::count();
     $nb_posts = Post::count();
     $nb_pages = Page::count();
     return view('admin.admin', compact('nb_users', 'nb_posts', 'nb_pages'));
 }
开发者ID:victorboissiere,项目名称:Synergie,代码行数:12,代码来源:DashboardController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $validator = Validator::make($request->all(), ['title' => 'required|min:5|max:60|unique:pages']);
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator)->withInput();
     }
     $page = new Page();
     if ($request->sort_id > 0) {
         $page->sort_id = $request->sort_id;
     } else {
         $page->sort_id = $page->count() + 1;
     }
     $page->slug = !empty($request->slug) ? $request->slug : str_slug($request->title);
     $page->title = $request->title;
     $page->title_description = $request->title_description;
     $page->meta_description = $request->meta_description;
     $page->text = $request->text;
     if ($request->status == 'on') {
         $page->status = 1;
     } else {
         $page->status = 0;
     }
     $page->save();
     return redirect('/admin/pages')->with('status', 'Страница добавлена!');
 }
开发者ID:vizovteam,项目名称:vizov,代码行数:30,代码来源:AdminPagesController.php

示例4: index

 public function index()
 {
     $pages = \App\Page::count();
     $banners = \App\Banner::count();
     $coupons = \App\Coupons::count();
     $posts = \App\Post::count();
     $users = \App\User::count();
     $images = \App\Image::count();
     return view('home')->with('pages', $pages)->with('banners', $banners)->with('coupons', $coupons)->with('posts', $posts)->with('users', $users)->with('images', $images);
 }
开发者ID:Gadurp1,项目名称:KD-2,代码行数:10,代码来源:AdminController.php


注:本文中的app\Page::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。