Skip to content

validator doesn't work #2998

@schel4ok

Description

@schel4ok

Describe the bug
Validator almost not working:

  1. gte:0 doesn't give any error.
  2. after:plan_start_datetime gives error only when date field is empty, but when it is before plan_start_datetime no errors

To Reproduce

    public function create(Request $request)
    {
        $request->validate([
            'task.name' => 'required|max:255',
            'task.progress' => 'gte:0',
            'task.plan_end_datetime' => 'after:plan_start_datetime',
            'task.deadline' => 'after:plan_end_datetime',

        ]);

        $task = new Task();
        $task->name = $request->input('task.name');
        $task->plan_start_datetime = $request->input('task.plan_start_datetime');
        $task->plan_end_datetime = $request->input('task.plan_end_datetime');
        $task->deadline = $request->input('task.deadline');
        $task->fact_end_datetime = $request->input('task.fact_end_datetime');
        $task->save();
    }

Image

Desktop (please complete the following information):

  • OS: docker-desktop 4.40 on Win10
  • Browser chrome
  • Version 135.0.7049.85

Server (please complete the following information):

  • Platfrom Version: 14.50.1
  • Laravel Version: 12.8.1
  • PHP Version: 8.2.8
  • Database: mariadb
  • Database Version: 11.7.2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions