applied new scopes to factories
This commit is contained in:
parent
0f9ad51316
commit
663b1a5d6a
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user