diff --git a/database/factories/Contact.php b/database/factories/Contact.php new file mode 100644 index 000000000..5a2e659c5 --- /dev/null +++ b/database/factories/Contact.php @@ -0,0 +1,28 @@ +companies()->first(); + +$factory->define(Contact::class, function (Faker $faker) use ($company) { + setting()->setExtraColumns([ + 'company_id' => $company->id + ]); + + return [ + 'company_id' => $company->id, + 'type' => $faker->boolean ? 'customer' : 'vendor', + 'name' => $faker->text(15), + 'email' => '', + 'user_id' => null, + 'tax_number' => null, + 'phone' => null, + 'address' => null, + 'website' => null, + 'currency_code' => setting('default.currency'), + 'reference' => null, + 'enabled' => $faker->boolean ? 1 : 0 + ]; +});