public static function deleteAttachment($routesConfigFile, $resource, $objectId, $lang = null)
    {
        Attachment::deleteAttachment([
            'lang_id_016'       => $lang,
            'resource_id_016'   => $resource,
            'object_id_016'     => $objectId
        ]);

        if(isset($lang))
        {
            if(!empty($objectId) &&  !empty($lang))
            {
                // delete all attachments from this object
                $response = File::deleteDirectory(public_path() . config($routesConfigFile . '.attachmentFolder') . '/' . $objectId. '/' . $lang);
            }
            else
            {
                throw new InvalidArgumentException('Object Id, is not defined to delete attachment files');
            }

        }
        else
        {
            if(!empty($objectId))
            {
                // delete all attachments from this object
                $response = File::deleteDirectory(public_path() . config($routesConfigFile . '.attachmentFolder') . '/' . $objectId);
            }
            else
            {
                throw new InvalidArgumentException('Object Id, is not defined to delete attachment files');
            }
        }

        return $response;
    }
public static function deleteAttachment($routesConfigFile, $resource, $objectId, $lang = null)
    {
        Attachment::deleteAttachment([
            'lang_id_016'       => $lang,
            'resource_id_016'   => $resource,
            'object_id_016'     => $objectId
        ]);

        if(isset($lang))
        {
            if(!empty($objectId) &&  !empty($lang))
            {
                // delete all attachments from this object
                $response = File::deleteDirectory(public_path() . config($routesConfigFile . '.attachmentFolder') . '/' . $objectId. '/' . $lang);
            }
            else
            {
                throw new InvalidArgumentException('Object Id, is not defined to delete attachment files');
            }

        }
        else
        {
            if(!empty($objectId))
            {
                // delete all attachments from this object
                $response = File::deleteDirectory(public_path() . config($routesConfigFile . '.attachmentFolder') . '/' . $objectId);
            }
            else
            {
                throw new InvalidArgumentException('Object Id, is not defined to delete attachment files');
            }
        }

        return $response;
    }
public static function deleteAttachment ( $ routesConfigFile , $ resource , $ objectId , $ lang = null ) { Attachment :: deleteAttachment ( [ 'lang_id_016' => $ lang , 'resource_id_016' => $ resource , 'object_id_016' => $ objectId ] ) ; if ( isset ( $ lang ) ) { if ( ! empty ( $ objectId ) && ! empty ( $ lang ) ) { // delete all attachments from this object $ response = File :: deleteDirectory ( public_path ( ) . config ( $ routesConfigFile . '.attachmentFolder' ) . '/' . $ objectId . '/' . $ lang ) ; } else { throw new InvalidArgumentException ( 'Object Id, is not defined to delete attachment files' ) ; } } else { if ( ! empty ( $ objectId ) ) { // delete all attachments from this object $ response = File :: deleteDirectory ( public_path ( ) . config ( $ routesConfigFile . '.attachmentFolder' ) . '/' . $ objectId ) ; } else { throw new InvalidArgumentException ( 'Object Id, is not defined to delete attachment files' ) ; } } return $ response ; }
Function to delete attachment

@access	public
@param   string      $routesConfigFile
@param   string      $resource
@param   integer     $objectId
@param   string      $lang
@return  boolean     $response
Function to delete attachment