From 663b1a5d6ac27870fb89b482b57e84d88d8a9cc5 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 7 Apr 2020 14:48:25 +0300 Subject: [PATCH] applied new scopes to factories --- database/factories/Bill.php | 4 +--- database/factories/Invoice.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/database/factories/Bill.php b/database/factories/Bill.php index 160457af4..daed8e6c3 100644 --- a/database/factories/Bill.php +++ b/database/factories/Bill.php @@ -23,9 +23,7 @@ $factory->define(Bill::class, function (Faker $faker) use ($company) { $billed_at = $faker->dateTimeBetween(now()->startOfYear(), now()->endOfYear())->format('Y-m-d'); $due_at = Date::parse($billed_at)->addDays(10)->format('Y-m-d'); - $types = (string) setting('contact.type.vendor', 'vendor'); - - $contacts = Contact::type(explode(',', $types))->enabled()->get(); + $contacts = Contact::vendor()->enabled()->get(); if ($contacts->count()) { $contact = $contacts->random(1)->first(); diff --git a/database/factories/Invoice.php b/database/factories/Invoice.php index ae8bd7707..7c0cabd89 100644 --- a/database/factories/Invoice.php +++ b/database/factories/Invoice.php @@ -24,9 +24,7 @@ $factory->define(Invoice::class, function (Faker $faker) use ($company) { $invoiced_at = $faker->dateTimeBetween(now()->startOfYear(), now()->endOfYear())->format('Y-m-d'); $due_at = Date::parse($invoiced_at)->addDays(setting('invoice.payment_terms'))->format('Y-m-d'); - $types = (string) setting('contact.type.customer', 'customer'); - - $contacts = Contact::type(explode(',', $types))->enabled()->get(); + $contacts = Contact::customer()->enabled()->get(); if ($contacts->count()) { $contact = $contacts->random(1)->first();