Skip to content

Conversation

@binaryk
Copy link
Collaborator

@binaryk binaryk commented Dec 4, 2024

Added

add defaultCallback method

@what-the-diff
Copy link

what-the-diff bot commented Dec 4, 2024

PR Summary

  • Introduction of "Default Stored Value" Section
    A new section called "Default Stored Value" has been added to fields.md, it will help users understand how to set default values for fields using either a callback or value.

  • New Property fillDefaultCallback
    A new property named fillDefaultCallback has been included in Field.php, it's designed to store the callback which returns the default value.

  • New Method defaultCallback
    The Field.php file now has a new method named defaultCallback. This method accepts either a callable function or a value to be used as a default.

  • Changes to fillAttribute Method
    The fillAttribute method in Field.php has been updated to use the newly introduced method fillAttributeFromDefault. This change should improve the assignment of default values.

  • Adding fillAttributeFromDefault Method
    A new method fillAttributeFromDefault has been created in Field.php, allowing for default values to be assigned to an attribute that is not yet set.

  • Refactoring of Validation Rules in File.php
    Modification to the validation rules in File.php has been refactored to use the helper function named str() for string checks. This refinement should improve the process of conducting string validations.

@binaryk binaryk merged commit b15e3f6 into 9.x Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants