'Parent', 'max_size_kb' => 100, 'is_active' => true, ]); $child = AttachmentGroup::create([ 'name' => 'Child', 'parent_id' => $parent->id, 'position' => 1, 'max_size_kb' => 100, 'is_active' => true, ]); $extension = AttachmentExtension::create([ 'extension' => 'png', 'attachment_group_id' => $parent->id, 'allowed_mimes' => ['image/png'], ]); $parent->load(['children', 'extensions']); $child->load('parent'); expect($parent->children->first()->id)->toBe($child->id); expect($parent->extensions->first()->id)->toBe($extension->id); expect($child->parent?->id)->toBe($parent->id); });