. */ declare(strict_types=1); use FireflyIII\Models\AccountType; use Illuminate\Database\Seeder; /** * Class AccountTypeSeeder */ class AccountTypeSeeder extends Seeder { public function run() { $types = [ AccountType::DEFAULT, AccountType::CASH, AccountType::ASSET, AccountType::EXPENSE, AccountType::REVENUE, AccountType::INITIAL_BALANCE, AccountType::BENEFICIARY, AccountType::IMPORT, AccountType::LOAN, AccountType::RECONCILIATION, AccountType::DEBT, AccountType::MORTGAGE, AccountType::CREDITCARD, ]; foreach ($types as $type) { try { AccountType::create(['type' => $type]); } catch (PDOException $e) { Log::warning(sprintf('Could not create account type "%s". It might exist already: %s', $type , $e->getMessage())); } } } }