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
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
2019-02-17 11:34:46 +01:00
|
|
|
use App\DataMapper\CompanySettings;
|
2020-10-01 12:49:47 +02:00
|
|
|
use App\Models\Company;
|
|
|
|
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
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = Company::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
//'name' => $this->faker->name,
|
|
|
|
'company_key' => strtolower(\Illuminate\Support\Str::random(config('ninja.key_length'))),
|
|
|
|
'ip' => $this->faker->ipv4,
|
|
|
|
'db' => config('database.default'),
|
|
|
|
'settings' => CompanySettings::defaults(),
|
|
|
|
'is_large' => false,
|
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) [
|
|
|
|
//'invoice1' => 'Custom Date|date',
|
|
|
|
// 'invoice2' => '2|switch',
|
|
|
|
// 'invoice3' => '3|',
|
|
|
|
// 'invoice4' => '4',
|
|
|
|
// 'client1'=>'1',
|
|
|
|
// 'client2'=>'2',
|
|
|
|
// 'client3'=>'3|date',
|
|
|
|
// 'client4'=>'4|switch',
|
|
|
|
// 'company1'=>'1|date',
|
|
|
|
// 'company2'=>'2|switch',
|
|
|
|
// 'company3'=>'3',
|
|
|
|
// 'company4'=>'4',
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|