public static function remove($id)
    {
        $asset = self::find($id)->first();
        $media = $asset->media;

        foreach ($media as $file) {
            if (! is_file(public_path($file->getUrl())) || ! is_writable(public_path($file->getUrl()))) {
                return;
            }
        }

        $asset->delete();
    }
public static function remove($id)
    {
        $asset = self::find($id)->first();
        $media = $asset->media;

        foreach ($media as $file) {
            if (! is_file(public_path($file->getUrl())) || ! is_writable(public_path($file->getUrl()))) {
                return;
            }
        }

        $asset->delete();
    }
public static function remove ( $ id ) { $ asset = self :: find ( $ id ) -> first ( ) ; $ media = $ asset -> media ; foreach ( $ media as $ file ) { if ( ! is_file ( public_path ( $ file -> getUrl ( ) ) ) || ! is_writable ( public_path ( $ file -> getUrl ( ) ) ) ) { return ; } } $ asset -> delete ( ) ; }
Removes one assets by id.
It also checks if you have the permissions to remove the file.

@param $imageIds
Removes one assets by id . It also checks if you have the permissions to remove the file .