Importer can restore deleted genres if needed

This commit is contained in:
Josef Citrine 2017-05-15 21:01:59 +01:00
parent b89a0344d4
commit 1f74636a39

View file

@ -208,8 +208,11 @@ class ImportPonify extends Command
$this->info('Genre: '.$genreName);
if ($genreName) {
$genre = Genre::where('name', '=', $genreName)->first();
$genre = Genre::withTrashed()->where('name', '=', $genreName)->first();
if ($genre) {
if ($genre->deleted_at == null) {
$genre->restore();
}
$genreId = $genre->id;
} else {