github Relaticle/custom-fields 3.0.0-beta1

pre-release14 hours ago

🎉 Custom Fields 3.0.0-beta1

This is the first beta release of Custom Fields 3.x, introducing powerful new features for multi-value fields, enhanced validation, and improved UI flexibility.

✨ New Features

Multi-Value Field Support

  • Email & Link Fields: Both field types now support multiple values using an intuitive tags input interface
  • Validation: Added defaultItemValidationRules() for validating individual items in multi-value fields
  • Migration Command: New php artisan custom-fields:migrate-email-values command to migrate existing email field values to the new array format
  • Smart Defaults: Automatically sets max_values when enabling the allow_multiple toggle

Unique Constraint Enhancements

  • Unique Per Entity Type: New option to enforce field uniqueness per entity type rather than globally
  • Smart Availability: Unique constraint option now only appears for applicable field types (text, email, number, etc.)
  • Improved Validation: Enhanced unique validation with proper entity type morph alias resolution

Flat Field Layout Mode

  • New Feature Flag: UI_FLAT_FIELD_LAYOUT - disable sections entirely for a simplified single-page field management experience
  • Hidden Default Section: When enabled, the default section is automatically hidden
  • Consistent Rendering: Flat layout respected across forms, infolists, and the management interface

Auto-Generated Field Codes

  • Automatically generate field codes from field names for faster field creation
  • Reduces manual work when creating new custom fields

Enhanced Email Fields

  • Searchable: Email fields now support searchable capability for better table filtering
  • Multi-Value Input Component: Dedicated component for managing multiple email addresses

🚀 Improvements

Type Safety & Code Quality

  • Improved type handling with new SafeValueConverter methods for safe string conversions
  • Enhanced type hinting throughout the codebase for better IDE support
  • Updated return types for form and infolist components
  • Applied Rector code quality improvements

UI/UX Enhancements

  • Dark Mode: Full dark mode support with proper styling for empty states
  • Field Card Density: Improved field card layout with better icon styling
  • Simplified Management: Streamlined field form layout with entity type auto-detection
  • New Translations: Added translations for new field settings and empty state messages

Architecture Improvements

  • Extracted shared field management methods into ManagesFields trait
  • Extracted field creation logic into CreatesCustomFields trait
  • New DefaultSectionService for managing default section behavior
  • Better separation of concerns in Livewire components

🐛 Bug Fixes

  • ULID Compatibility: Fixed support for both string and integer entity IDs to work with ULID primary keys
  • Morph Alias Resolution: Deferred morph alias resolution until runtime to prevent boot-time errors
  • Section Display: Corrected field visibility when sections are disabled
  • Flat Layout Rendering: Proper respect for flat layout feature flag in form and infolist builders

🔧 Refactoring & Cleanup

  • Removed redundant isMultiValueField() method
  • Removed unused MigrateEmailFieldValuesCommand from service provider after moving to custom-fields namespace
  • Removed unused getTypeSettings() method
  • Cleaned up unused imports and variables
  • Improved code organization with better trait extraction

⚠️ Breaking Changes

Multi-Value Email Fields

If you're upgrading from 2.x and have existing email fields that should support multiple values:

  1. Run the migration command: php artisan custom-fields:migrate-email-values
  2. Update any custom code that assumes email fields contain single string values

Feature Flags

  • SYSTEM_SECTIONS_DISABLED has been renamed to UI_FLAT_FIELD_LAYOUT for clarity

📦 Installation & Upgrade

composer require relaticle/custom-fields:^3.0@beta

For upgrade instructions from 2.x, please refer to the upgrade guide.

🔗 Links

Full Changelog: 2.0.5...3.0.0-beta1


Note: This is a beta release intended for testing. Please report any issues on GitHub Issues.

Don't miss a new custom-fields release

NewReleases is sending notifications on new releases.