mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -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;
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Account;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Account::class, function (Faker $faker) {
|
||||
return [
|
||||
'default_company_id' => 1,
|
||||
'key' => Str::random(32),
|
||||
'report_errors' => 1,
|
||||
];
|
||||
});
|
||||
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 [
|
||||
'default_company_id' => 1,
|
||||
'key' => Str::random(32),
|
||||
'report_errors' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user