Converting L7 model factories to L9

L8
This commit is contained in:
David Bomba 2020-10-01 15:36:42 +10:00
parent 16b731d010
commit 1c747cb5c8

View File

@ -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,
];
}
}