public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate(["content" => "required|max:1024"]);
        $note = Note::findOrFail($id);
        $note->content = $request->get("content");
        $this->authorize('manage', $note);
        $note->save();
        return fractal($note, new NoteTransformer())
            ->withResourceName('note')
            ->respond();

    }
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate(["content" => "required|max:1024"]);
        $note = Note::findOrFail($id);
        $note->content = $request->get("content");
        $this->authorize('manage', $note);
        $note->save();
        return fractal($note, new NoteTransformer())
            ->withResourceName('note')
            ->respond();

    }
public function update ( Request $ request , $ id ) { /** @noinspection PhpUndefinedMethodInspection */ $ request -> validate ( [ "content" => "required|max:1024" ] ) ; $ note = Note :: findOrFail ( $ id ) ; $ note -> content = $ request -> get ( "content" ) ; $ this -> authorize ( 'manage' , $ note ) ; $ note -> save ( ) ; return fractal ( $ note , new NoteTransformer ( ) ) -> withResourceName ( 'note' ) -> respond ( ) ; }
Store an updated Note
@param  \Illuminate\Http\Request $request current Request object
@param string $id UUID of Note to update
@return \Illuminate\Http\Response JSON object of updated Note
Store an updated Note