public function store(Request $request)
    {
        $member = Member::findOrFail($request->memberId);
        $this->authorize('attachMemberTagMember', $member);
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            "memberId" => "exists:" . config('combine-core.tablePrefix', 'combine') . "_members,id",
            "memberTagId" => "exists:" . config('combine-core.tablePrefix', 'combine') . "_member_tags,id",
        ]);
        /** @noinspection PhpUndefinedMethodInspection */
        $member->member_tags()->attach($request->memberTagId);
        return fractal($member, new MemberTransformer())
            ->withResourceName('memberTagMember')
            ->respond();
    }
public function store(Request $request)
    {
        $member = Member::findOrFail($request->memberId);
        $this->authorize('attachMemberTagMember', $member);
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            "memberId" => "exists:" . config('combine-core.tablePrefix', 'combine') . "_members,id",
            "memberTagId" => "exists:" . config('combine-core.tablePrefix', 'combine') . "_member_tags,id",
        ]);
        /** @noinspection PhpUndefinedMethodInspection */
        $member->member_tags()->attach($request->memberTagId);
        return fractal($member, new MemberTransformer())
            ->withResourceName('memberTagMember')
            ->respond();
    }
public function store ( Request $ request ) { $ member = Member :: findOrFail ( $ request -> memberId ) ; $ this -> authorize ( 'attachMemberTagMember' , $ member ) ; /** @noinspection PhpUndefinedMethodInspection */ $ request -> validate ( [ "memberId" => "exists:" . config ( 'combine-core.tablePrefix' , 'combine' ) . "_members,id" , "memberTagId" => "exists:" . config ( 'combine-core.tablePrefix' , 'combine' ) . "_member_tags,id" , ] ) ; /** @noinspection PhpUndefinedMethodInspection */ $ member -> member_tags ( ) -> attach ( $ request -> memberTagId ) ; return fractal ( $ member , new MemberTransformer ( ) ) -> withResourceName ( 'memberTagMember' ) -> respond ( ) ; }
Add a MemberTag to the Member.

@param  Request $request Current request object
@return \Illuminate\Http\Response Created MemberTag
Add a MemberTag to the Member .