app/Http/Controllers/Post.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(Request $request, $post)
    {
        request()->validate([
                'title'=>'required',
                'content'=>'required',
            ]);
        $success = Posts::where('id',$post)->update([
            'title'=>request('title'),
            'content'=>request('content'),
        ]);
        return [
            'success' => $success
        ];
    }
public function update ( Request $ request , $ post ) { request ( ) -> validate ( [ 'title' => 'required' , 'content' => 'required' , ] ) ; $ success = Posts :: where ( 'id' , $ post ) -> update ( [ 'title' => request ( 'title' ) , 'content' => request ( 'content' ) , ] ) ; return [ 'success' => $ success ] ; }
Update the specified resource in storage.
Update the specified resource in storage .