當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Requests\ArticleRequest類代碼示例

本文整理匯總了PHP中App\Http\Requests\ArticleRequest的典型用法代碼示例。如果您正苦於以下問題:PHP ArticleRequest類的具體用法?PHP ArticleRequest怎麽用?PHP ArticleRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ArticleRequest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 public function store(ArticleRequest $request)
 {
     Article::create($request->all());
     session()->flash('success', 'Новость добавлена');
     // $_SESSION['success'] = 'Новость добавлена'
     return redirect()->route('main');
 }
開發者ID:belhard-user,項目名稱:group2,代碼行數:7,代碼來源:_BlogController.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($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

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(ArticleRequest $request, $id)
 {
     $article = Article::find($id);
     $article->fill($request->all());
     $article->save();
     return redirect()->route('admin.articles.index')->with('message', 'Se ha editado ' . $article->name . ' de forma correcta.');
 }
開發者ID:pcasanellasp,項目名稱:bigseonetwork,代碼行數:14,代碼來源:ArticlesController.php

示例5: 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

示例6: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\ArticleRequest $request, $id)
 {
     $article = Article::findOrFail($id);
     $article->update($request->all());
     $article->tags()->sync($request->get('tag_list', []));
     return redirect()->action('Goenitz\\ArticleController@index');
 }
開發者ID:tianyirenjian,項目名稱:laravel-blog,代碼行數:14,代碼來源:ArticleController.php

示例7: 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->get('tag_list'));
     session()->flash('success', 'Запись ' . $request->get('title') . ' обновлена');
     return redirect()->route('article.index');
 }
開發者ID:belhard-user,項目名稱:group2,代碼行數:14,代碼來源:BlogController.php

示例8: update

 public function update(ArticleRequest $request, $id)
 {
     $article = Article::findOrFail($id);
     $article->update($request->all());
     session()->flash('flash_message', 'Article Updated!');
     return redirect('/articles');
 }
開發者ID:mathewsandi,項目名稱:PennasSite,代碼行數:7,代碼來源:ArticleController.php

示例9: 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

示例10: update

 public function update(Article $article, ArticleRequest $request)
 {
     // $article = Article::findOrFail($id);
     $article->update($request->all());
     \Session::flash('flash_message', '記事を更新しました。');
     // return redirect(url('articles', [$article->id]));
     return redirect()->route('articles.show', [$article->id]);
 }
開發者ID:akokubu,項目名稱:laravel_sample,代碼行數:8,代碼來源:ArticlesController.php

示例11: 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());
     return redirect('articles');
 }
開發者ID:HaoYang0000,項目名稱:FirstLaravelProject,代碼行數:8,代碼來源:ArticleController.php

示例12: 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

示例13: 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

示例14: 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

示例15: 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


注:本文中的App\Http\Requests\ArticleRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。