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


PHP PostRequest::get方法代碼示例

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


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

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request\PostRequest  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(PostRequest $request, Post $post)
 {
     $this->authorize('update', $post);
     $post->title = $request->get('title');
     $post->text = $request->get('text');
     $post->abstract = $post->getAbstract($request->get('text'));
     $post->user_id = Auth::user()->id;
     $post->save();
     Flash::success('Post successfully updated');
     return redirect('posts');
 }
開發者ID:Jimbol4,項目名稱:blog,代碼行數:18,代碼來源:PostController.php

示例2: update

 /**
  * PUT admin/posts/{post}
  *
  * @param Post        $post
  * @param PostRequest $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function update(Post $post, PostRequest $request)
 {
     $post->update($request->all());
     if ($request->has('tag_list')) {
         $post->tags()->sync(Tag::findOrCreateMany($request->get('tag_list')));
     }
     flash()->success('The post has been updated');
     return redirect('/admin/posts');
 }
開發者ID:spitzgoby,項目名稱:spitzgoby,代碼行數:16,代碼來源:PostsController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(PostRequest $request)
 {
     $post = $request->all();
     $archive = Archive::whereYearAndMonth(date("Y"), date("n"))->first();
     if ($archive) {
         $post['archive_id'] = $archive->id;
     } else {
         $newArchive = Archive::create(['year' => date("Y"), 'month' => date("n")]);
         $post['archive_id'] = $newArchive->id;
     }
     $post['slug'] = str_slug($post['title']);
     $post = Post::create($post);
     CategoryPost::create(['category_id' => $request->get("category_id"), 'post_id' => $post->id]);
 }
開發者ID:rakeen,項目名稱:creative,代碼行數:19,代碼來源:PostsController.php

示例4: update

 /**
  * @param PostRequest $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(PostRequest $request, $id)
 {
     $post = Post::findOrFail($id);
     $post->name = $request->get("name");
     $post->content = $request->get("content");
     $post->save();
     $this->sync($post, $request->input("tags"));
     return redirect()->route("posts.index")->with("message", "The post was updated");
 }
開發者ID:essteffan,項目名稱:laravel,代碼行數:14,代碼來源:PostController.php

示例5: modifyInput

 /**
  * Return the fields and values
  */
 public function modifyInput(PostRequest $request)
 {
     return ['title' => $request->title, 'subtitle' => $request->subtitle, 'images' => $request->images, 'text' => $request->get('text'), 'preview' => $request->preview, 'meta_description' => $request->meta_description, 'meta_keywords' => $request->meta_keywords, 'enabled' => (bool) $request->enabled, 'date_from' => $request->date_from];
 }
開發者ID:visor86,項目名稱:blogs,代碼行數:7,代碼來源:Post.php


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