app/Http/Controllers/GroupUserController.php
/**
     * Decline join request or invite
     *
     * @param GroupUser $groupUser
     * @return mixed
     */
Decline join request or invite
@param GroupUser $groupUser
@return mixed
Decline join request or invite @param GroupUser $groupUser @return mixed
public function decline(GroupUser $groupUser)
    {
        $this->authorize($groupUser);
        switch ($groupUser->status) {
            case 'accept':
                return redirect()->back()->withErrors('User already joined the group!');
            case 'invite':
                return redirect()->back()->withErrors('Invite is sent to this user!');
        }
        $groupUser->delete();
        return redirect()->back()->with('success', trans('groups.user-declined'));
    }
public function decline ( GroupUser $ groupUser ) { $ this -> authorize ( $ groupUser ) ; switch ( $ groupUser -> status ) { case 'accept' : return redirect ( ) -> back ( ) -> withErrors ( 'User already joined the group!' ) ; case 'invite' : return redirect ( ) -> back ( ) -> withErrors ( 'Invite is sent to this user!' ) ; } $ groupUser -> delete ( ) ; return redirect ( ) -> back ( ) -> with ( 'success' , trans ( 'groups.user-declined' ) ) ; }
Decline join request or invite
 @param GroupUser $groupUser
 @return mixed
Decline join request or invite @param GroupUser $groupUser @return mixed