public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            'description' => 'max:256',
            'name' => 'required|max:32',
        ]);
        $memberTag = MemberTag::findOrFail($id);
        $this->authorize('update', $memberTag);
        if ($request->has('description')) {
            $memberTag->description = $request->description;
        }
        $memberTag->name = $request->name;
        $memberTag->save();
        return fractal($memberTag, new MemberTagTransformer())
            ->withResourceName('memberTag')
            ->respond();

    }
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            'description' => 'max:256',
            'name' => 'required|max:32',
        ]);
        $memberTag = MemberTag::findOrFail($id);
        $this->authorize('update', $memberTag);
        if ($request->has('description')) {
            $memberTag->description = $request->description;
        }
        $memberTag->name = $request->name;
        $memberTag->save();
        return fractal($memberTag, new MemberTagTransformer())
            ->withResourceName('memberTag')
            ->respond();

    }
public function update ( Request $ request , $ id ) { /** @noinspection PhpUndefinedMethodInspection */ $ request -> validate ( [ 'description' => 'max:256' , 'name' => 'required|max:32' , ] ) ; $ memberTag = MemberTag :: findOrFail ( $ id ) ; $ this -> authorize ( 'update' , $ memberTag ) ; if ( $ request -> has ( 'description' ) ) { $ memberTag -> description = $ request -> description ; } $ memberTag -> name = $ request -> name ; $ memberTag -> save ( ) ; return fractal ( $ memberTag , new MemberTagTransformer ( ) ) -> withResourceName ( 'memberTag' ) -> respond ( ) ; }
Store an updated MemberTag
@param  \Illuminate\Http\Request $request current Request object
@param string $id UUID of MemberTag to update
@return \Illuminate\Http\Response JSON object of updated MemberTag
Store an updated MemberTag