@@ -523,7 +523,7 @@ public function boot()
523523
524524 Validator::extend ('greater_than_field ' , function ($ attribute , $ value , $ parameters , $ validator ) {
525525 $ validator ->addReplacer ('greater_than_field ' , function ($ message , $ attribute , $ rule , $ parameters ) use ($ validator ) {
526- return sprintf ("%s should be greather than %s " , $ attribute , $ parameters [0 ]);
526+ return sprintf ("%s should be greater than %s " , $ attribute , $ parameters [0 ]);
527527 });
528528 $ data = $ validator ->getData ();
529529 if (is_null ($ value ) || intval ($ value ) == 0 ) return true ;
@@ -534,6 +534,19 @@ public function boot()
534534 return true ;
535535 });
536536
537+ Validator::extend ('greater_or_equal_than_field ' , function ($ attribute , $ value , $ parameters , $ validator ) {
538+ $ validator ->addReplacer ('greater_or_equal_than_field ' , function ($ message , $ attribute , $ rule , $ parameters ) use ($ validator ) {
539+ return sprintf ("%s should be greater or equal than %s " , $ attribute , $ parameters [0 ]);
540+ });
541+ $ data = $ validator ->getData ();
542+ if (is_null ($ value ) || intval ($ value ) == 0 ) return true ;
543+ if (isset ($ data [$ parameters [0 ]])) {
544+ $ compare_to = $ data [$ parameters [0 ]];
545+ return intval ($ compare_to ) <= intval ($ value );
546+ }
547+ return true ;
548+ });
549+
537550 Validator::extend ('valid_epoch ' , function ($ attribute , $ value , $ parameters , $ validator ) {
538551 $ validator ->addReplacer ('valid_epoch ' , function ($ message , $ attribute , $ rule , $ parameters ) use ($ validator ) {
539552 return sprintf ("%s should be a valid epoch value " , $ attribute );
0 commit comments