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


PHP Page::fill方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //dd($request->all());
     $this->validate($request, ['name' => 'required', 'slug' => 'unique:pages,slug', 'body' => 'required']);
     $page = new Page();
     if ($request->hasFile('featured_image')) {
         $featured_image = $page->uploadImage($request->featured_image);
     }
     $page->fill($request->all());
     if (isset($featured_image)) {
         $page->featured_image = $featured_image;
     }
     $page->save();
     Session::flash('flash_message', 'Síðan var vistuð');
     return redirect()->back();
 }
开发者ID:dadigu,项目名称:haskolabru,代码行数:22,代码来源:PagesController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $page = new Page();
     $page->fill($request->all());
     $slug = Helpers::makeSlug($request->input('title_geo'), 'pages');
     if ($slug == "") {
         return Redirect::route('admin.index');
     }
     $page->slug = $slug;
     $image = $request->file('image');
     $fileName = "";
     if ($image->isValid()) {
         $path = public_path() . '/uploads/pages/';
         $fileName = str_random(32) . '.' . $image->getClientOriginalExtension();
         $image->move($path, $fileName);
     } else {
         App::abort(404);
     }
     $page->image = $fileName;
     $page->save();
     return Redirect::route('admin.pages.show');
 }
开发者ID:nikajorjika,项目名称:gamoiwere.ge,代码行数:28,代码来源:PageController.php

示例3: update

 /**
  * Update the specified page in storage.
  *
  * @param Page $page
  * @param PageRequest $request
  * @return Response
  */
 public function update(Page $page, PageRequest $request)
 {
     $page->fill($request->all());
     $page->save() == true ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail'));
     return redirect(route('admin.page.index'));
 }
开发者ID:abada,项目名称:laravel-5-simple-cms,代码行数:13,代码来源:PageController.php

示例4: update

 public function update(PageRequest $request, Page $page)
 {
     if (!Entrust::can('edit_page')) {
         return redirect('/dashboard')->withErrors(config('constants.NA'));
     }
     $data = $request->all();
     $page->fill($data);
     $page->page_slug = Helper::createSlug($data['page_title']);
     $page->save();
     Helper::updateCustomField($this->form, $page->id, $data);
     $activity = 'Edit a page';
     Activity::log($activity);
     return redirect('/page')->withSuccess(config('constants.SAVED'));
 }
开发者ID:EneaWeb,项目名称:aliangel,代码行数:14,代码来源:PageController.php

示例5: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \App\Page  $page
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Page $page)
 {
     $request->replace(['name' => $request->get('name'), 'title' => str_slug($request->get('name')), 'body' => $request->get('body')]);
     $this->validate($request, ['name' => ["required", "unique:pages,name,{$page->page_id},page_id", "max:255"], 'title' => ["required", "unique:pages,title,{$page->page_id},page_id", "max:255"], 'body' => 'required']);
     $page->fill(['name' => $request->get('name'), 'title' => $request->get('title'), 'body' => $request->get('body')]);
     Session::flash('success', trans('config.success'));
     $page->save();
     return $this->edit($page);
 }
开发者ID:tmrwbo,项目名称:infinity-next,代码行数:16,代码来源:PageController.php


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