app/Http/Controllers/PostController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Post  $post
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Post $post)
    {
        $request->validate([
            'post_name' => 'required', 
            'post_content' => 'required',
            'post_title' => 'required',
        ]);
        $post->update($request->all());
        return redirect()->route('posts.index')
                        ->with('success','l article est mis a jour avec succé');
    }
public function update ( Request $ request , Post $ post ) { $ request -> validate ( [ 'post_name' => 'required' , 'post_content' => 'required' , 'post_title' => 'required' , ] ) ; $ post -> update ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'posts.index' ) -> with ( 'success' , 'l article est mis a jour avec succé') ; }
Update the specified resource in storage.
Update the specified resource in storage .
//