mphpmaster / laravel-nova-date-field
Laravel Nova Date Field
2.0.0
2023-04-01 05:15 UTC
Requires
- php: >=8
- laravel/framework: >=7
- laravel/nova: >=3
README
Extending Laravel\Nova\Fields\Date
adding helpers methods.
Installation
composer require mphpmaster/laravel-nova-date-field
Usage
public function fields(Request $request) { return [ Date::make('start_date')->addRuleBeforeOrEqual('end_date'); Date::make('end_date')->addRuleAfterOrEqual('start_date'); ]; }
Date Field Methods And Arguments:
Method addRuleAfter
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method addRuleAfterOrEqual
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method addRuleBefore
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method addRuleBeforeOrEqual
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method setRuleAfter
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method setRuleAfterOrEqual
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method setRuleBefore
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method setRuleBeforeOrEqual
:
$attributeOrValue
: Model attribute, or any date like today() or 01-01-2023.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method afterToday
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method afterYesterday
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method afterOrEqualToday
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method afterOrEqualYesterday
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method beforeToday
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method beforeTomorrow
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method beforeOrEqualToday
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Method beforeOrEqualTomorrow
:
$append_rules = true
: To append or override existing rules.$is_creation = false
: UsecreationRules
method.$is_update = false
: UseupdateRules
method.
Note: if both
$is_creation
and$is_update
arefalse
it will userules
method.
License
This helper is released under the MIT License (MIT). Please see the included license file for more information.