app/Http/Controllers/Admin/PostController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(UpdatePostRequest $request, $id)
    {
        $post = Post::find($id);
		$input = $request->except(['_token']);
		$data = array(
			'title'		=> trim($input['title']),
			'content'	=> $input['content']
		);
		$post->updatePost($data);
		$message = session()->flash('success', 'you have successfully updated a post with ID '.$id.' .');
		return redirect()->route('admin.posts.index')->withFlashMessage($message);
    }
public function update ( UpdatePostRequest $ request , $ id ) { $ post = Post :: find ( $ id ) ; $ input = $ request -> except ( [ '_token' ] ) ; $ data = array ( 'title' => trim ( $ input [ 'title' ] ) , 'content' => $ input [ 'content' ] ) ; $ post -> updatePost ( $ data ) ; $ message = session ( ) -> flash ( 'success' , 'you have successfully updated a post with ID ' . $ id . ' .' ) ; return redirect ( ) -> route ( 'admin.posts.index' ) -> withFlashMessage ( $ message ) ; }
Update the specified resource in storage.
Update the specified resource in storage .