withPersonalCompany(function (CompanyFactory $factory) { return $factory ->state([ 'name' => 'ERPSAAS', ]) ->withTransactions(); }) ->create([ 'name' => 'Admin', 'email' => 'admin@gmail.com', 'password' => bcrypt('password'), 'current_company_id' => 1, // Assuming this will be the ID of the created company ]); } }