$now_date = new DateTime(); $due_date = new DateTime($project->due_date); if ($now_date > $due_date) { return redirect()->route('user.projects.index')->with('warningMessage', __('cruds.project.due_date_passed')); }