Get contact types from setting
This commit is contained in:
@ -21,7 +21,9 @@ $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');
|
||||
|
||||
$contacts = Contact::type('vendor')->enabled()->get();
|
||||
$types = (string) setting('contact.type.vendor', 'vendor');
|
||||
|
||||
$contacts = Contact::type(explode(',', $types))->enabled()->get();
|
||||
|
||||
if ($contacts->count()) {
|
||||
$contact = $contacts->random(1)->first();
|
||||
|
@ -21,7 +21,9 @@ $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');
|
||||
|
||||
$contacts = Contact::type('customer')->enabled()->get();
|
||||
$types = (string) setting('contact.type.customer', 'customer');
|
||||
|
||||
$contacts = Contact::type(explode(',', $types))->enabled()->get();
|
||||
|
||||
if ($contacts->count()) {
|
||||
$contact = $contacts->random(1)->first();
|
||||
|
Reference in New Issue
Block a user