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


PHP ArticleRequest::input方法代码示例

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


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

示例1: store

 /**
  *  stores a new Article in the database
  *
  * @param ArticleRequest $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(ArticleRequest $request)
 {
     $article = new Article($request->all());
     Auth::user()->articles()->save($article);
     $article->tags()->attach($request->input('tag_list'));
     return redirect('articles')->with(['flash_message' => 'The Article has been published!', 'flash_message_important' => true]);
 }
开发者ID:starkbaum,项目名称:laracasts-learning-laravel-5,代码行数:13,代码来源:ArticlesController.php

示例2: createArticle

 private function createArticle(ArticleRequest $request)
 {
     //Create an article with the attributes from the form
     $article = Auth::user()->articles()->create($request->all());
     $this->syncTags($article, $request->input('tag_list'));
     return $article;
 }
开发者ID:arnoldllanes,项目名称:laracasts,代码行数:7,代码来源:ArticlesController.php

示例3: update

 public function update(Article $article, ArticleRequest $request)
 {
     $article->update($request->all());
     $article->tags()->sync($request->input('tag_list', []));
     \Flash::success('記事を更新しました。');
     return redirect()->route('articles.show', [$article->id]);
 }
开发者ID:ry-htr,项目名称:laravel-sample,代码行数:7,代码来源:ArticlesController.php

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param  ArticleRequest  $request
  * @param  Article  $article
  * @return Response
  */
 public function update(ArticleRequest $request, Article $article)
 {
     $article->update($request->all());
     $article->tags()->sync($request->input('tag_list', []));
     Flash::success(trans('message.entity_updated', ['entity' => trans('models.article')]));
     return redirect()->route('admin.articles.edit', ['id' => $article->id]);
 }
开发者ID:larasite,项目名称:larasite,代码行数:14,代码来源:ArticlesController.php

示例5: update

 public function update($id, ArticleRequest $request)
 {
     $article = Article::findOrFail($id);
     $article->tags()->sync($request->input('tag_list'));
     $article->update($request->all());
     return redirect('articles');
 }
开发者ID:JohnathanBere,项目名称:laraproject,代码行数:7,代码来源:ArticlesController.php

示例6: createArticle

 private function createArticle(ArticleRequest $request)
 {
     $article = new Article($request->all());
     $article_id = Auth::user()->articles()->save($article);
     //returns id of article
     $this->syncTags($article_id, $request->input('tag_list'));
     return $article_id;
 }
开发者ID:SigurdMW,项目名称:learning-laravel-5,代码行数:8,代码来源:ArticlesController.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @param ArticleRequest|Request $request
  * @return \Illuminate\Http\Response
  */
 public function store(ArticleRequest $request)
 {
     $article = Auth::user()->articles()->create($request->all());
     /* @var $article Article */
     $article->tags()->attach($request->input('tag_list'));
     flash()->success('Article has been created!');
     return redirect('admin\\article');
 }
开发者ID:mattvb91,项目名称:website-laravel,代码行数:14,代码来源:ArticleController.php

示例8: update

 public function update(Requests\ArticleRequest $request, $id)
 {
     $article = Article::findOrFail($id);
     $article->update($request->all());
     $article->tags()->sync($request->input('tag_list'));
     // sync - delete old & add new tags
     return redirect('articles');
 }
开发者ID:svkmedia,项目名称:SVKmedia-CMS,代码行数:8,代码来源:ArticlesController.php

示例9: createArticle

 private function createArticle(Requests\ArticleRequest $request)
 {
     $article = new Article($request->all());
     $article = Auth::user()->articles()->save($article);
     $tagIds = $request->input('tag_list');
     $this->syncTags($article, $tagIds);
     return $article;
 }
开发者ID:cronycles,项目名称:learning-laravel-5,代码行数:8,代码来源:ArticlesController.php

示例10: update

 public function update(Article $article, Requests\ArticleRequest $request)
 {
     //type hinting ArticleRequest lets us do validation
     //$article = Article::findOrFail($id);
     $article->update($request->all());
     $article->tags()->sync($request->input('tag_list'));
     return redirect('articles');
 }
开发者ID:bartolini69,项目名称:Laracast-Tutorials,代码行数:8,代码来源:ArticlesController.php

示例11: store

 public function store(ArticleRequest $request)
 {
     $article = Auth::user()->articles()->create($request->all());
     $tagIds = $request->input('tag_list');
     $article->tags()->attach($tagIds);
     flash()->overlay('Your article has been created', 'Good Job');
     return redirect('articles');
 }
开发者ID:mzvast,项目名称:laravel_learning,代码行数:8,代码来源:ArticlesController.php

示例12: createArticle

 private function createArticle(ArticleRequest $request)
 {
     $article = \Auth::user()->articles()->create($request->all());
     $tagIds = $request->input("taglist");
     //returns array of submitted ids of tags
     $article->tags()->attach($tagIds);
     return $article;
 }
开发者ID:Aetheus,项目名称:tutorials-and-exercises,代码行数:8,代码来源:ArticlesController.php

示例13: store

 public function store(ArticleRequest $request)
 {
     //Automatic Validation because of App\Http\Requests\CreateArticleRequest
     $article = new Article($request->all());
     \Auth::user()->articles()->save($article);
     //Article::create($request->all());
     $tagIds = $request->input('tag_list');
     $article->tags()->attach($tagIds);
     \Session::flash('flash_message', 'Your article has been created!');
     \Session::flash('flash_message_important', true);
     return redirect('articles');
 }
开发者ID:NaiqiWang,项目名称:FirstLaravelProject,代码行数:12,代码来源:ArticleController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(ArticleRequest $request)
 {
     $article = Auth::user()->articles()->create($request->all());
     $this->syncTags($article, $request->input('tag_list'));
     if ($request->hasFile('cover')) {
         $this->uploadFile($article, $request->file('cover'));
     }
     if ($request->has('twitter')) {
         $this->tweet($article);
     }
     session()->flash('flash_message', 'Se ha publicado tu artículo');
     return redirect('admin/articles');
 }
开发者ID:realnerdo,项目名称:blog,代码行数:19,代码来源:ArticlesController.php

示例15: createArticle

 /**
  * Save a new article
  * @param  ArticleRequest $request
  * @return mixed
  */
 private function createArticle(ArticleRequest $request)
 {
     $user = Sentinel::getUser();
     $articleCredentials = ['title' => strtolower($request->get('title')), 'user_id' => $user->id, 'lang' => $request->get('lang'), 'body' => $request->get('body'), 'published_at' => $request->get('published_at')];
     $article = Article::create($articleCredentials);
     $tags = (array) $request->input('tag_list');
     if (count($tags)) {
         $this->syncTags($article, $tags);
     }
     return $article;
 }
开发者ID:ramigit3D,项目名称:article,代码行数:16,代码来源:ArticlesController.php


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