Destroy given member media.

@param \Cortex\Auth\Models\Member        $member
@param \Spatie\MediaLibrary\Models\Media $media

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
513679
public function destroy(Member $member, Media $media)
    {
        $member->media()->where($media->getKeyName(), $media->getKey())->first()->delete();

        return intend([
            'url' => route('frontarea.account.settings'),
            'with' => [
                'warning' => trans('cortex/foundation::messages.resource_deleted', [
                    'resource' => trans('cortex/foundation::common.media'),
                    'identifier' => $media->getRouteKey(),
                ]),
            ],
        ]);
    }
939131
public function destroy($user)
    {
        $user = User::find($user);
        if (!$user) {
            return redirect_to_resource();
        }

        $this->deleteEntry($user, request());

        return redirect_to_resource();
    }
841085
public function canDelete($member = null)
    {
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
            $member = Member::currentUser();
        }

        $results = $this->extend('canDelete', $member);

        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
        }

        return $this->canEdit($member);
    }
382702
void removeMember(MemberImpl member) {
        heartbeatFailureDetector.remove(member);
        if (icmpParallelMode) {
            icmpFailureDetector.remove(member);
        }
    }
592541
public function removeMember($member)
    {
        $member = ($member instanceof Model ? $member->getDn() : $member);

        if (is_null($member)) {
            throw new InvalidArgumentException(
                'Cannot remove member to group. The members distinguished name cannot be null.'
            );
        }

        $mod = $this->newBatchModification(
            $this->schema->member(),
            LDAP_MODIFY_BATCH_REMOVE,
            [$member]
        );

        return $this->addModification($mod)->save();
    }
507665
public function deleteMedia($mediaId)
    {
        if ($mediaId instanceof Media) {
            $mediaId = $mediaId->id;
        }

        $media = $this->media->find($mediaId);

        if (! $media) {
            throw MediaCannotBeDeleted::doesNotBelongToModel($mediaId, $this);
        }

        $media->delete();
    }
1365867
public function destroy(PhotoAlbum $album, Request $request)
    {
        $this->deleteEntry($album, $request);

        return redirect_to_resource();
    }
40142
public function deleteAction(MediaFolder $mediaFolder)
    {
        if (!$this->isGranted('DELETE', $mediaFolder)) {
            throw new AccessDeniedHttpException(sprintf('You are not authorized to delete %s MediaFolder.', $mediaFolder->getTitle()));
        }

        if ($mediaFolder->isRoot()) {
            throw new BadRequestHttpException('Cannot remove the root node of the MediaFolder.');
        }

        $response = new Response('', 204);
        if (0 === (int) $this->getMediaRepository()->countMedias($mediaFolder)) {
            $this->getMediaFolderRepository()->delete($mediaFolder);
        } else {
            $response = new Response(sprintf('MediaFolder `%s` is not empty.', $mediaFolder->getTitle()), 500);
        }

        return $response;
    }
951367
public function destroy($memberTagId, $id)
    {
        $member = Member::findOrFail($id);
        $this->authorize('detachMemberTagMember', $member);
        /** @noinspection PhpUndefinedMethodInspection */
        $member->member_tags()->detach($memberTagId);
        return fractal($member->id, new DeletedTransformer())
            ->withResourceName('deletedMember')
            ->respond();
    }
1242273
public static function clear(Member $member, $alcDevice = null)
    {
        if (!$member->exists()) {
            return;
        }
        $filter = array('MemberID'=>$member->ID);
        if (!static::config()->logout_across_devices && $alcDevice) {
            $filter['DeviceID'] = $alcDevice;
        }
        RememberLoginHash::get()
            ->filter($filter)
            ->removeAll();
    }
1297023
public function removeMember(GroupMemberInterface $member)
    {
        if (!$this->hasMember($member)) {
            throw new \InvalidArgumentException('Trying to remove a member that is not in that group');
        }

        $this->members->removeElement($member);
    }
246694
protected function CanEdit(Member $member)
    {
        return self::Guard()->Allow(BackendAction::Edit(), $member) && 
                self::Guard()->Allow(BackendAction::UseIt(), new MemberForm());
    }
17078
public function sismembers($key, $member) {
        try {
            return $this->getRedis()->sIsMember($key, $member);
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
703293
public function deleteMember($member, $reason = null, $silence = 0)
    {
        $request = new DeleteGroupMemberRequest($this->groupId, $member, $reason, $silence);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
745987
public function destroy(Manager $manager, Media $media)
    {
        $manager->media()->where($media->getKeyName(), $media->getKey())->first()->delete();

        return intend([
            'url' => route('adminarea.managers.edit', ['manager' => $manager]),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/foundation::common.media'), 'identifier' => $media->getRouteKey()])],
        ]);
    }
273234
public function destroy($id)
    {
        $memberInvitation = MemberInvitation::findOrFail($id);
        $this->authorize('destroy', $memberInvitation);
        $memberInvitation->delete();
        return fractal($id, new DeletedTransformer())
            ->withResourceName('deletedMemberInvitation')
            ->respond();
    }
38930
public function sRem($key, $member, ...$members) {
        return $this->send(array_merge(['srem', $key], (array) $member, $members));
    }