app/Http/Controllers/PostController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Post  $post
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Post $post)
    {
         request()->validate([
             'title' => 'required',
             'content' => 'required'
         ]);
        $post->update([
            'title' => request('title'),
            'content' => request('content')
        ]);
        return redirect('/posts');
    }
public function update ( Post $ post ) { request ( ) -> validate ( [ 'title' => 'required' , 'content' => 'required' ] ) ; $ post -> update ( [ 'title' => request ( 'title' ) , 'content' => request ( 'content' ) ] ) ; return redirect ( '/posts' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//Validate - required fields  //Updates to the DB // redirects back to url/posts after submitting update.