diff --git a/database/seeds/InvoiceDesignsSeeder.php b/database/seeds/InvoiceDesignsSeeder.php index e117d99326..0dd7d38f91 100644 --- a/database/seeds/InvoiceDesignsSeeder.php +++ b/database/seeds/InvoiceDesignsSeeder.php @@ -41,12 +41,16 @@ class InvoiceDesignsSeeder extends Seeder for ($i = 1; $i <= 3; $i++) { $name = 'Custom' . $i; - if (! InvoiceDesign::whereName($name)->first()) { - InvoiceDesign::create([ - 'id' => $i + 10, - 'name' => $name, - ]); + $id = $i + 10; + + if (InvoiceDesign::whereName($name)->orWhere('id', '=', $id)->first()) { + continue; } + + InvoiceDesign::create([ + 'id' => $id, + 'name' => $name, + ]); } } }