withPersonalCompany() // Ensures the user has a personal company created alongside ->create([ 'name' => 'Admin', 'email' => 'admin@gmail.com', 'password' => bcrypt('password'), 'current_company_id' => 1, // Assuming this will be the ID of the created company 'created_at' => now(), ]); // Optionally, set additional properties or create related entities specific to this company $adminUser->ownedCompanies->first()->update([ 'name' => 'ERPSAAS', 'created_at' => now(), ]); } }