本文整理汇总了PHP中App\Http\Requests\ArticleRequest::all方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleRequest::all方法的具体用法?PHP ArticleRequest::all怎么用?PHP ArticleRequest::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Requests\ArticleRequest
的用法示例。
在下文中一共展示了ArticleRequest::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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]);
}
示例2: store
public function store(ArticleRequest $request)
{
Article::create($request->all());
session()->flash('success', 'Новость добавлена');
// $_SESSION['success'] = 'Новость добавлена'
return redirect()->route('main');
}
示例3: 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');
}
示例4: 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]);
}
示例5: 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');
}
示例6: 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;
}
示例7: store
public function store(ArticleRequest $request)
{
// Auth::user()->articles returns collection
$article = Auth::user()->articles()->create($request->all());
$article->tags()->attach($request->input('tag_list'));
return redirect('articles')->with(['flash_message' => 'Your article has been created', 'flash_message_important' => true]);
}
示例8: 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');
}
示例9: 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.');
}
示例10: update
public function update(ArticleRequest $request, $id)
{
$article = Article::findOrFail($id);
$article->update($request->all());
session()->flash('flash_message', 'Article Updated!');
return redirect('/articles');
}
示例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');
}
示例12: 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;
}
示例13: 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]);
}
示例14: 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;
}
示例15: 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');
}