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


PHP Page::where方法代码示例

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


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

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(\App\Http\Requests\StorePageRequest $request, $id)
 {
     $page = \App\Page::where(['id' => $id])->first();
     $page->fill($request->all());
     $page->save();
     return redirect(url('admin'));
 }
开发者ID:lukebee,项目名称:artexplo,代码行数:14,代码来源:AdminPagesController.php

示例2: welcome

 public function welcome(Service $serviceModel)
 {
     $sliders = Slider::all();
     $services = $serviceModel->getService();
     $page = Page::where('name', '=', 'home')->firstOrFail();
     return view('welcome')->with('sliders', $sliders)->with('services', $services)->with('page', $page);
 }
开发者ID:sashacitylight,项目名称:sashasite,代码行数:7,代码来源:LayoutController.php

示例3: show

 public function show()
 {
     $page = Page::where('slug', 'netklubbur')->first();
     $data['page'] = $page;
     $data['banner'] = $page->banner;
     return view('frontend.netklubbur')->with($data);
 }
开发者ID:stjanilofts,项目名称:ofncms,代码行数:7,代码来源:NetklubburController.php

示例4: home

 public function home()
 {
     $data['forsidumyndir'] = \App\Page::where('slug', '_forsidumyndir')->first()->getSubs();
     $cats = \App\Category::where('status', 1)->get();
     $prods = \App\Product::where('status', 1)->get();
     $items = [$cats, $prods];
     $kubbar = [];
     foreach ($items as $item) {
         foreach ($item as $v) {
             $frontpaged = trim($v->extras()->get('frontpaged')) ?: 0;
             $size = trim($v->extras()->get('size'));
             $titill = trim($v->extras()->get('titill')) ?: $v->title;
             if ($frontpaged && $frontpaged != 0) {
                 $kubbar[] = ['title' => $titill, 'size' => $size ? $size : 1, 'frontpaged' => $frontpaged, 'fillimage' => $v->fillimage ? true : false, 'path' => $v->fullPath(), 'image' => $v->img()->first(), 'slug' => $v->slug];
             }
         }
     }
     usort($kubbar, function ($a, $b) {
         if ($a['frontpaged'] == $b['frontpaged']) {
             return 0;
         }
         return $a['frontpaged'] < $b['frontpaged'] ? -1 : 1;
     });
     $data['kubbar'] = $kubbar;
     return view('frontend.layout')->with($data);
 }
开发者ID:stjanilofts,项目名称:kl,代码行数:26,代码来源:HomeController.php

示例5: search

 public function search()
 {
     $keywords = Input::get('keyword');
     $RecentPage = Page::where('id', '>=', 1)->orderBy('created_at', 'desc')->take(5)->get();
     $result = Page::where('title', 'like', '%' . $keywords . '%')->paginate(3);
     return view('index.home', ['time' => date('Y-m-d H:i:s')])->withPages($result)->withRecentpages($RecentPage);
 }
开发者ID:luowc302,项目名称:SelfProject,代码行数:7,代码来源:HomeController.php

示例6: update

 /**
  * Update the specified resource in storage.
  *
  * @param PageRequest|Request $request
  * @param Project $project
  * @param Module $module
  * @param Page $page
  * @return \Illuminate\Http\Response
  */
 public function update(PageRequest $request, Project $project, Module $module, Page $page)
 {
     if (isset($_POST['module_id'])) {
         $module_id = $_POST['module_id'];
         $pages = Page::where('module_id', '=', $module_id)->get();
         foreach ($pages as $page) {
             $page->update($request->all());
             $page->save();
         }
         return redirect()->route('project.module.show', [$project, $module]);
     }
     if (isset($_POST['module_name'])) {
         $pages = $_POST;
         $module = Module::where('project_id', '=', $project->id)->where('name', '=', $_POST['module_name'])->first();
         foreach ($pages as $val) {
             if (is_numeric($val)) {
                 $p = Page::where('id', '=', $val)->first();
                 $p->module_id = $module->id;
                 $p->save();
             }
         }
     }
     $page->update($request->all());
     $page->save();
     return redirect()->route('project.module.show', [$project, $module]);
 }
开发者ID:AmilcarCondino,项目名称:Circulo_v2,代码行数:35,代码来源:PageController.php

示例7: show

 public function show(Request $request, $url_name)
 {
     if ($url_name == 'contact') {
         //$data = array('name','mail','note');
         /*
         foreach($this->in as $val) {
             //$pageObjs[$key] = $val;
             $pageObjs[$val] = $request->session()->pull($val, '');
         }
         */
         //session()->forget(['name','mail','note']);
         //            $obj = $this->page -> where('url_name', $request->path()) -> first();
         //            $headTitle = $obj -> title;
         //            $intro_ct = $obj -> intro_content;
         $headTitle = 'お問い合わせ';
         return view('pages.contact', ['headTitle' => $headTitle]);
     } else {
         if ($pageObj = Page::where('url_name', $url_name)->first()) {
             if ($pageObj->closed == '非公開' && (!Auth::user() || Auth::user()->admin != 99)) {
                 abort(404);
             } else {
                 return view('pages.page')->with(compact('pageObj'));
             }
         } else {
             abort(404);
         }
     }
 }
开发者ID:szcrystal,项目名称:woau_backup,代码行数:28,代码来源:PageController.php

示例8: edit

 public function edit(Post $post)
 {
     $data['tags'] = Tag::lists('name', 'id');
     $data['pages'] = Page::where('status', 1)->lists('title', 'id');
     $data['post'] = $post;
     return view('post.update', $data);
 }
开发者ID:Yuth-Set,项目名称:cms,代码行数:7,代码来源:PostController.php

示例9: show

 public function show($slug)
 {
     $page = Page::where('slug', $slug)->first();
     $courses = Course::published()->hasCategory()->orderBy('created_at', 'desc')->take(4)->get();
     $articles = Article::published()->orderBy('published_at', 'desc')->take(2)->get();
     return view('pages.show', ['page' => $page, 'latest_courses' => $courses, 'latest_articles' => $articles]);
 }
开发者ID:dadigu,项目名称:haskolabru,代码行数:7,代码来源:PagesController.php

示例10: index

 public function index(Request $request)
 {
     $page_slug = trim($request->page_slug);
     $pageData = Cache::rememberForever('pageData_' . $page_slug, function () use($page_slug) {
         return Page::where('page_slug', $page_slug)->firstOrFail();
     });
     return view('page.page', ['pageData' => $pageData]);
 }
开发者ID:gdinko,项目名称:dclassifieds.laravel,代码行数:8,代码来源:PageController.php

示例11: getItem

 public function getItem($cat, $item)
 {
     $category = Category::where('sef', '=', $cat)->first();
     $item = Page::where('sef', $item)->first();
     $previous = Page::where('id', '<', $item->id)->orderBy('id', 'desc')->first();
     $next = Page::where('id', '>', $item->id)->orderBy('id', 'asc')->first();
     $category = Category::where('id', $item->category_id)->first();
     return view('steklo.item')->withCategory($category)->withItem($item)->withPrevious($previous)->withNext($next);
 }
开发者ID:schel4ok,项目名称:steklo,代码行数:9,代码来源:StekloController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $pages = Page::where('module_id', '=', $_GET)->get();
     $existing_pages_count = Page::where('module_id', '=', $_GET)->count();
     $projected_pages = Module::where('id', '=', $_GET)->pluck('projected_total_pages');
     $pages_count = $projected_pages - $existing_pages_count;
     return view('pages.index', compact('pages', 'pages_count'));
 }
开发者ID:AmilcarCondino,项目名称:circulo,代码行数:14,代码来源:PagesController.php

示例13: index

 function index()
 {
     $first = 'Kenneth';
     $last = 'Sinder';
     $courses = ['Foundations of Sequential Programs', 'Digital Computers', 'Data Abstraction and Implementation', 'Logic and Computation'];
     // TODO: add to DB
     $text = Page::where('location', 'about')->first()->text;
     return view('about.index')->with(compact('first', 'last', 'courses', 'text'));
 }
开发者ID:kennethsinder,项目名称:code-in-motion,代码行数:9,代码来源:AboutController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $q = new RecordQueryBuilder($request, 'dommer', DommerRecord::class);
     $q->make();
     $data = ['prefix' => 'dommer', 'query' => $request->all(), 'columns' => $q->getColumns(), 'sortColumn' => $q->sortColumn, 'sortOrder' => $q->sortOrder, 'intro' => Page::where('name', '=', 'dommer.intro')->first()->body];
     $data['records'] = $q->query->join('dommer_kilder', 'dommer.kilde_id', '=', 'dommer_kilder.id')->select('dommer.*', 'dommer_kilder.navn AS kilde_navn')->paginate(50);
     $data['kilder'] = $this->getKilder();
     return response()->view('dommer.index', $data);
 }
开发者ID:scriptotek,项目名称:ub-baser,代码行数:14,代码来源:DommerController.php

示例15: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex(Request $request)
 {
     if (!$request->jenis) {
         return redirect(route('menu', ['jenis' => 'Header']));
     } else {
         $Menus = Menu::where('lokasi', $request->jenis)->where('parent_id', 0)->orderBy('urutan', 'asc')->get();
         $Kategori = Kategori::orderBy('nama_kategori', 'asc')->get();
         $Pages = Page::where('draft', 0)->where('arsip', 0)->orderBy('id', 'desc')->get();
         return view('admin.menu.index', ['Menus' => $Menus, 'Kategori' => $Kategori, 'Pages' => $Pages, 'Jenis' => $request->jenis]);
     }
 }
开发者ID:MediaSaktiTeam,项目名称:MS_kelautan,代码行数:16,代码来源:MenuController.php


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