mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 00:04:37 -04:00
Converting L7 model factories to L9
L8
This commit is contained in:
parent
16b731d010
commit
1c747cb5c8
@ -10,13 +10,31 @@
|
|||||||
*/
|
*/
|
||||||
namespace Database\Factories;
|
namespace Database\Factories;
|
||||||
|
|
||||||
use Faker\Generator as Faker;
|
use App\Models\Account;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
$factory->define(App\Models\Account::class, function (Faker $faker) {
|
class AccountFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = Account::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
return [
|
return [
|
||||||
'default_company_id' => 1,
|
'default_company_id' => 1,
|
||||||
'key' => Str::random(32),
|
'key' => Str::random(32),
|
||||||
'report_errors' => 1,
|
'report_errors' => 1,
|
||||||
];
|
];
|
||||||
});
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user