. */ declare(strict_types=1); namespace Database\Factories\FireflyIII\Models; use FireflyIII\Models\Account; use Illuminate\Database\Eloquent\Factories\Factory; /** * Class AccountFactory */ class AccountFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Account::class; /** * @inheritDoc */ public function definition() { return [ 'user_id' => 1, 'account_type_id' => 1, 'name' => $this->faker->words(3, true), 'virtual_balance' => '0', 'active' => 1, 'encrypted' => 0, 'order' => 1, ]; } /** * @return AccountFactory */ public function asset() { return $this->state( function () { return [ 'account_type_id' => 3, ]; } ); } /** * @return AccountFactory */ public function initialBalance() { return $this->state( function () { return [ 'account_type_id' => 6, ]; } ); } /** * @return AccountFactory */ public function expense() { return $this->state( function () { return [ 'account_type_id' => 4, ]; } ); } }