get()->each(function (Customer $customer) { collect(DepartaimantCollectionType::all()) ->each(fn (DepartaimantCollectionType $type) => DepartaimantsCollection::factory(1, ['type' => $type])->make() ->each(function ($collection) use ($customer) { $collection->customer()->associate($customer); $collection->save(); })); }); } }