php - How to check the submitted date is not before the today's date in laravel 5 request class? -


here code in request class.

public function rules() {       return [         'title' => 'required',         'eventdate' => 'required|date|before:today',       ]; }  public function messages(){     return [         'title.required' => 'title required.',         'eventdate.before' => 'event date passed',         'eventdate.required' => 'event date required.',      ]; }` 

this view class code

@if($errors->has('eventdate.required'))     <p style="color: red">{{$errors->first('eventdate.required')}}</p> @endif @if($errors->has('eventdate.before'))     <p style="color: red">{{$errors->first('eventdate.before')}}</p> @endif 

i want compare submitted date today's date. if submitted date earlier date today's date, error message should displayed.but there should mistakes in code.

enter image description here


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -