2018-10-22 14:04:37 +02:00
|
|
|
<?php
|
2020-10-01 07:33:38 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-10-01 07:33:38 +02:00
|
|
|
*
|
2022-06-21 11:57:17 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2020-10-01 07:33:38 +02:00
|
|
|
*/
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2020-10-01 07:33:38 +02:00
|
|
|
namespace Database\Factories;
|
|
|
|
|
2023-04-28 08:42:15 +02:00
|
|
|
use App\DataMapper\CompanySettings;
|
2023-11-26 08:41:42 +01:00
|
|
|
use App\DataMapper\Tax\TaxModel;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
2020-10-01 12:49:47 +02:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2018-10-22 14:04:37 +02:00
|
|
|
|
2020-10-01 12:49:47 +02:00
|
|
|
class CompanyFactory extends Factory
|
|
|
|
{
|
2022-06-07 12:36:47 +02:00
|
|
|
use MakesHash;
|
2022-06-21 12:03:51 +02:00
|
|
|
|
2020-10-01 12:49:47 +02:00
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
2022-06-21 11:59:36 +02:00
|
|
|
//'name' => $this->faker->name(),
|
2020-10-01 12:49:47 +02:00
|
|
|
'company_key' => strtolower(\Illuminate\Support\Str::random(config('ninja.key_length'))),
|
2022-06-21 11:59:36 +02:00
|
|
|
'ip' => $this->faker->ipv4(),
|
2020-10-01 12:49:47 +02:00
|
|
|
'db' => config('database.default'),
|
|
|
|
'settings' => CompanySettings::defaults(),
|
|
|
|
'is_large' => false,
|
2022-06-21 11:57:17 +02:00
|
|
|
'default_password_timeout' => 30 * 60000,
|
2020-10-07 01:16:57 +02:00
|
|
|
'enabled_modules' => config('ninja.enabled_modules'),
|
2020-10-01 12:49:47 +02:00
|
|
|
'custom_fields' => (object) [
|
|
|
|
],
|
2022-06-07 12:36:47 +02:00
|
|
|
'company_key' => $this->createHash(),
|
2023-04-28 08:42:15 +02:00
|
|
|
'tax_data' => new TaxModel(),
|
2020-10-01 12:49:47 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|