Home > other >  Custom Form-Request dosen't work as expected- Backpack
Custom Form-Request dosen't work as expected- Backpack

Time:05-21

I'm creating a user management in Laravel using Backpack package, the main functionallity works well, I mean, you can create new users and then log in with them and deleteor edit them. But there is an aspect that dosent works as I want it. The problem is that when you edit it you must insert a password too to save the edits, this is not correct because you can not modify the password. To solve this, following the enter image description here

CodePudding user response:

If you call setupCreateOperation() at the end of your setupUpdateOperation() then the CreateRequest will override the UpdateRequest. What you can do instead is do that first:

    protected function setupUpdateOperation()
    {
        $this->setupCreateOperation();
        $this->crud->setValidation(EditUserRequest::class);
    }

  • Related