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


PHP PostRequest::input方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(PostRequest $request)
 {
     $post = new Post();
     $topic_id = $request->input('topic_id');
     $post->content = $request->input('content');
     $post->user_id = $request->user()->id;
     $post->topic_id = $topic_id;
     $post->save();
     return Redirect::action('TopicController@show', array('id' => $topic_id));
 }
开发者ID:prudywsh,项目名称:tpe,代码行数:16,代码来源:PostController.php

示例2: update

 public function update(PostRequest $request, $id)
 {
     $post = \App\Post::findOrFail($id);
     $post->update($request->all());
     $post->tags()->sync($request->input('tag_list'));
     return redirect('admin/post');
 }
开发者ID:KirillVladimirov,项目名称:usefulcode.ru-laravel,代码行数:7,代码来源:PostController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(PostRequest $request)
 {
     $Article = Auth::user()->posts()->create($request->all());
     $Article->tags()->attach($request->input('tag_list'));
     Session::flash('success', 'El articulo se creo correctamente!');
     return back();
 }
开发者ID:Carlos-Stgo,项目名称:Apppromo,代码行数:13,代码来源:PostController.php

示例4: update

 public function update(PostRequest $request, $id, PhotoGestion $photoGestion)
 {
     if ($photoGestion->save($request->file('photo'))) {
         $post = $request->all();
         $post['photo'] = $photoGestion->getPictureLink();
         $this->postRepository->update($id, $post);
     }
     return redirect('post')->withOk("L'annonce " . $request->input('titre') . " a été modifié.");
 }
开发者ID:kondipakamey,项目名称:atofa,代码行数:9,代码来源:PostController.php

示例5: update

 public function update(PostRequest $request, Post $post)
 {
     if ($post->user()->getResults() != Auth::user()) {
         return response('Unauthorized.', 401);
     }
     $post->update($request->all());
     $post->tags()->detach();
     $post->tags()->attach($request->input('tags'));
     return view('posts.show', compact('post'));
 }
开发者ID:khaled-barca,项目名称:MyTunnelVision,代码行数:10,代码来源:PostController.php

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\PostRequest $request)
 {
     // Create new banner instance
     $post = new Post();
     // Save banner
     $post->title = $request->input('title');
     $post->slug = $request->input('slug');
     $post->content = $request->input('content');
     $post->category_id = $request->input('category_id');
     $post->status = $request->input('status');
     $post->comments = $request->input('comments');
     $post->featured = $request->input('featured');
     $post->summary = $request->input('summary');
     $post->save();
     // Set Flash Message
     session()->flash('flash_message', 'New Post Has Been Created!');
     // Redirect to new banner page
     return redirect('post/');
 }
开发者ID:Gadurp1,项目名称:KD-2,代码行数:24,代码来源:PostController.php

示例7: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\PostRequest $request, $id)
 {
     $post = Posts::where('id', $id)->firstOrFail();
     if (!empty($request->file('image')) && $request->file('image')->isValid()) {
         $destinationPath = public_path() . "/images/";
         // upload path
         $extension = $request->file('image')->getClientOriginalExtension();
         // getting image extension
         $fileName = $post->url . '.' . $extension;
         // renameing image
         $request->file('image')->move($destinationPath, $fileName);
         // uploading file to given path
         $post->image = $fileName;
     }
     $post->fill($request->only(['title', 'post']));
     $post->save();
     Posts::findOrFail($id)->tags()->detach();
     $tags = [];
     foreach ($this->getTags($request->input('tags')) as $tag) {
         if (!empty($tag)) {
             $isFind = Tags::where('name', $tag)->get()->count();
             if ($isFind == 0) {
                 $tags[] = new Tags(['name' => $tag]);
             } else {
                 $tags[] = Tags::where('name', $tag)->first();
             }
         }
     }
     $post->tags()->saveMany($tags);
     return back();
 }
开发者ID:draaslan,项目名称:codeman,代码行数:38,代码来源:PostController.php

示例8: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Requests\PostRequest $request
  * @param  Post $post
  * @return \Response
  */
 public function update(Requests\PostRequest $request, $post)
 {
     $post->update($request->input());
     return redirect()->back()->with('success', trans('post.updated'));
 }
开发者ID:siberianwolf,项目名称:demo-laravel,代码行数:12,代码来源:PostController.php

示例9: update

 public function update(PostRequest $request, Post $post)
 {
     $post->update($request->except(['_token']));
     $this->syncTags($post, $request->input('tag_list'));
     return redirect('dash/post')->with('message', 'Post was update success.');
 }
开发者ID:Yuth-Set,项目名称:cms,代码行数:6,代码来源:PostController.php

示例10: putThread

 /**
  * Handles the creation of a new thread or reply.
  *
  * @param  \App\Http\Requests\PostRequest  $request
  * @param  Board  $board
  * @param  Post|null  $thread
  * @return Response (redirects to the thread view)
  */
 public function putThread(PostRequest $request, Board $board, Post $thread = null)
 {
     // Create the post.
     $post = new Post($request->all());
     $post->submitTo($board, $thread);
     // Log staff posts.
     if ($post->capcode_id) {
         $this->log('log.post.capcode', $post, ["board_id" => $post->board_id, "board_uri" => $post->board_uri, "capcode" => $post->capcode->getCapcodeName(), "role" => $post->capcode->role]);
     }
     $input = $request->only('updatesOnly', 'updateHtml', 'updatedSince');
     if ($request->wantsJson()) {
         $updatedSince = Carbon::createFromTimestamp($request->input('updatedSince', Carbon::now()->subMinutes(4)->timestamp));
         $includeHTML = isset($input['updateHtml']);
         $posts = Post::getUpdates($updatedSince, $board, $thread, $includeHTML);
         $post->setAppendHTML($includeHTML);
         $posts->push($post);
         $posts->sortBy('board_id');
         return $posts;
     }
     // Redirect to the new post or thread.
     if ($post->reply_to_board_id) {
         return redirect("{$board->board_uri}/thread/{$post->reply_to_board_id}#{$post->board_id}");
     } else {
         return redirect("{$board->board_uri}/thread/{$post->board_id}#{$post->board_id}");
     }
 }
开发者ID:JEWSbreaking8chan,项目名称:infinity-next,代码行数:34,代码来源:BoardController.php

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

示例12: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Post $post, PostRequest $request)
 {
     $post->update($request->all());
     $post->tags()->sync($request->input('tags'));
     \Session::flash('flash_message_updated', 'Tu post ha sido actualizado');
     return redirect('posts');
 }
开发者ID:Zizazao,项目名称:evolutizalocal,代码行数:13,代码来源:indexController.php

示例13: update

 /**
  * ویرایش یک پست
  *
  * @param  App\Http\Requests\PostUpdateRequest $request
  * @param  int  $id
  * @return Response
  */
 public function update(PostRequest $request)
 {
     $pst_id = $request->input('pst_id');
     $this->PostRepository->update($request->all(), $pst_id);
     return response()->json();
 }
开发者ID:simorght,项目名称:laravel5-SampleProject,代码行数:13,代码来源:PostController.php

示例14: update

 /**
  * Update the specified resource in storage.
  *
  * @param  PostRequest  $request
  * @param  int  $id
  * @return Response
  */
 public function update(PostRequest $request, $id)
 {
     $post = Post::find($id);
     $data = $request->all();
     $data['user_id'] = Auth::user()->id;
     $post->update($data);
     $post->tags()->sync($request->input('tags'));
     if ($request->hasFile('thumbnail_link')) {
         $file = $request->file('thumbnail_link');
         $ext = $file->getClientOriginalExtension();
         $fileName = str_random(12) . '.' . $ext;
         ImageManagerStatic::make($file)->fit(200, 150)->save(public_path() . "/upload/" . $fileName);
         $post->thumbnail_link = $fileName;
         $post->save();
     }
     return redirect()->to('post')->with('message', 'Mise à jour de la conférence avec succès');
 }
开发者ID:AndryRana,项目名称:ConfPHP,代码行数:24,代码来源:PostController.php

示例15: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(PostRequest $request, $id)
 {
     //dd('we are here');
     if (isset($_POST['update'])) {
         // $this->validate($request,['title' => 'required','postdesc' => 'required|min:2','istate'=>'required']);
         $post = new Post();
         $post = Post::find($id);
         $post->title = $request->input('title');
         $post->body = $request->input('postdesc');
         $post->status = $request->input('istate');
         $post->save();
         $request->session()->flash('alert-info', 'Post is successfully updated!');
         return redirect('posts');
         // $posts=Post::all();
         // return view('post.index', ['posts'=>$posts]);
     }
 }
开发者ID:riz1,项目名称:blog-ahsan,代码行数:24,代码来源:PostsController.php


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