mirror of
https://github.com/nullthoughts/laravel-data-sync.git
synced 2026-02-03 18:48:36 +00:00
Filters for JSON files, closes #8
This commit is contained in:
@@ -106,9 +106,12 @@ class Updater
|
||||
return Collection::wrap($directory . '/' . $model . '.json');
|
||||
}
|
||||
|
||||
return collect(File::files($directory))->map(function ($path) {
|
||||
return $path->getPathname();
|
||||
});
|
||||
return collect(File::files($directory))
|
||||
->filter(function($file) {
|
||||
return pathinfo($file, PATHINFO_EXTENSION) == 'json';
|
||||
})->map(function ($path) {
|
||||
return $path->getPathname();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user