public function deleteResource(
        ResourceSet $sourceResourceSet,
        $sourceEntityInstance
    ) {
        $source = $this->unpackSourceEntity($sourceEntityInstance);

        $verb = 'delete';
        if (!($source instanceof Model)) {
            throw new InvalidArgumentException('Source entity must be an Eloquent model.');
        }

        $class = $sourceResourceSet->getResourceType()->getInstanceType()->getName();
        $id = $source->getKey();
        $name = $source->getKeyName();
        $data = [$name => $id];

        $data = $this->createUpdateDeleteCore($source, $data, $class, $verb);

        $success = isset($data['id']);
        if ($success) {
            return true;
        }
        throw new ODataException('Target model not successfully deleted', 422);
    }
public function deleteResource(
        ResourceSet $sourceResourceSet,
        $sourceEntityInstance
    ) {
        $source = $this->unpackSourceEntity($sourceEntityInstance);

        $verb = 'delete';
        if (!($source instanceof Model)) {
            throw new InvalidArgumentException('Source entity must be an Eloquent model.');
        }

        $class = $sourceResourceSet->getResourceType()->getInstanceType()->getName();
        $id = $source->getKey();
        $name = $source->getKeyName();
        $data = [$name => $id];

        $data = $this->createUpdateDeleteCore($source, $data, $class, $verb);

        $success = isset($data['id']);
        if ($success) {
            return true;
        }
        throw new ODataException('Target model not successfully deleted', 422);
    }
public function deleteResource ( ResourceSet $ sourceResourceSet , $ sourceEntityInstance ) { $ source = $ this -> unpackSourceEntity ( $ sourceEntityInstance ) ; $ verb = 'delete' ; if ( ! ( $ source instanceof Model ) ) { throw new InvalidArgumentException ( 'Source entity must be an Eloquent model.' ) ; } $ class = $ sourceResourceSet -> getResourceType ( ) -> getInstanceType ( ) -> getName ( ) ; $ id = $ source -> getKey ( ) ; $ name = $ source -> getKeyName ( ) ; $ data = [ $ name => $ id ] ; $ data = $ this -> createUpdateDeleteCore ( $ source , $ data , $ class , $ verb ) ; $ success = isset ( $ data [ 'id' ] ) ; if ( $ success ) { return true ; } throw new ODataException ( 'Target model not successfully deleted' , 422 ) ; }
Delete resource from a resource set.

@param ResourceSet $sourceResourceSet
@param object      $sourceEntityInstance

return bool true if resources sucessfully deteled, otherwise false
Delete resource from a resource set .