From 1f74636a397406a2b3a027e951a942f01518b6ce Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Mon, 15 May 2017 21:01:59 +0100 Subject: [PATCH] Importer can restore deleted genres if needed --- app/Console/Commands/ImportPonify.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/ImportPonify.php b/app/Console/Commands/ImportPonify.php index fa6a15ec..97a9b6ae 100644 --- a/app/Console/Commands/ImportPonify.php +++ b/app/Console/Commands/ImportPonify.php @@ -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 {