Skip to content

Validation Error In Laravel 11 #50

Open
@MusheAbdulHakim

Description

@MusheAbdulHakim

Call to undefined method Haruncpi\LaravelUserActivity\Controllers\ActivityController::validate().
I checked and reliazed the problem is coming from the handleData method of the ActivityController in your code.

$this->validate($request, [
            'action'    => 'required|string',
            'user_id'   => 'sometimes|numeric',
            'log_type'  => 'sometimes|string',
            'table'     => 'sometimes|string',
            'from_date' => 'sometimes|date_format:Y-m-d',
            'to_date'   => 'sometimes|date_format:Y-m-d'
        ]);

When I changed it to:

$request->validate([
            'action'    => 'required|string',
            'user_id'   => 'sometimes|numeric',
            'log_type'  => 'sometimes|string',
            'table'     => 'sometimes|string',
            'from_date' => 'sometimes|date_format:Y-m-d',
            'to_date'   => 'sometimes|date_format:Y-m-d'
        ]);

The problem was resolved. But for some other reason, I am not getting any log data in the UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions