app/Http/Controllers/API/CompanyController.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, $id)
    {
        $post = posts::find($id);
        $post->title = $request->title;
        $post->body = $request->body;
        if ($post->update()) {
            return response()->json(['status' => 'success']);
        } else {
            return response()->json(['status' => 'error']);
        }
    }
public function update ( Request $ request , $ id ) { $ post = posts :: find ( $ id ) ; $ post -> title = $ request -> title ; $ post -> body = $ request -> body ; if ( $ post -> update ( ) ) { return response ( ) -> json ( [ 'status' => 'success' ] ) ; } else { return response ( ) -> json ( [ 'status' => 'error' ] ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .
//  dd($request->title);