public function scopeInDirectory(Builder $q, $disk, $directory, $recursive = false)
    {
        $q->where('disk', $disk);
        if ($recursive) {
            $directory = str_replace(['%', '_'], ['\%', '\_'], $directory);
            $q->where('directory', 'like', $directory.'%');
        } else {
            $q->where('directory', '=', $directory);
        }
    }