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


PHP Article::fill方法代码示例

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


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

示例1: postCreate

 /**
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postCreate(Request $request)
 {
     $data = $request->all();
     $this->article->fill($data);
     $this->article->save();
     return redirect()->to('articles/index');
 }
开发者ID:tadashi0713,项目名称:laravelsample,代码行数:11,代码来源:ArticlesController.php

示例2: store

 public function store()
 {
     $article = new Article();
     $article->fill(\Input::only(['title', 'content']));
     $article->save();
     return redirect('/');
 }
开发者ID:nnanee,项目名称:pronoob,代码行数:7,代码来源:HomeController.php

示例3: postIndex

 public function postIndex(Request $request)
 {
     $article = new Article();
     $this->validate($request, ['title' => 'required', 'body' => 'required']);
     $article->fill($request->all());
     $article->save();
     return redirect('admin/create');
 }
开发者ID:jmf421,项目名称:Wikee,代码行数:8,代码来源:UserController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $article = new Article();
     $article->fill($request->except('published_at'));
     if ($request->get('is_published') == 'on') {
         $article->published_at = date('Y-m-d H:i:s', time());
     }
     $article->user_id = Auth::id();
     $article->save();
     return redirect('/admin/articles');
 }
开发者ID:TemRhythm,项目名称:blog,代码行数:17,代码来源:ArticleController.php

示例5: transformArray

 private function transformArray($hits)
 {
     $arr = [];
     foreach ($hits as $item) {
         $article = new Article();
         $article->fill($item['_source']);
         $article->getUrl();
         $arr[] = $article;
     }
     return $arr;
 }
开发者ID:mgonzo,项目名称:Laravel-Elasticsearch-React,代码行数:11,代码来源:ArticleRepository.php

示例6: 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, ['title' => 'required', 'slug' => 'unique:articles,slug', 'body' => 'required', 'published_at' => 'required|date', 'user_id' => 'required|integer']);
     $article = new Article();
     if ($request->hasFile('featured_image')) {
         $featured_image = $article->uploadImage($request->featured_image);
     }
     $article->fill(clean($request->all()));
     if (isset($featured_image)) {
         $article->featured_image = $featured_image;
     }
     $article->save();
     Session::flash('flash_message', 'Færslan var vistuð');
     return redirect()->back();
 }
开发者ID:dadigu,项目名称:haskolabru,代码行数:22,代码来源:ArticlesController.php

示例7: update

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

示例8: savePost

 /**
  * save.
  *
  * @param Article $article article
  * @param Request $input   输入
  */
 public function savePost($article, $input)
 {
     $article->fill($input);
     return $article->save();
 }
开发者ID:lanzhiwang,项目名称:laravel-blog,代码行数:11,代码来源:ArticleRepository.php


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