Hello.
I'm making a system which allows to edit a user, i have been using per route Routes schema, and today I changed to Route::resources which works pretty well with all the methods except one... PATCH (update). When i'm updating an user, it returns error for all the fields which have unique vlidation
public function rules()
{
return [
'username' => 'required|min:3|max:255|alpha_num|unique:users,username,'.$this->id,
'name' => 'required|min:3|max:255',
'email' => 'required|email|max:255|unique:users,email,'.$this->id,
'role_id' => 'required|integer'
];
}
Here are my rules in the UserRequest which work fine for create and update when sending through POST method, but if i use PATCH it does not take the $this->id in the rule... i know it because if i harcode the user_id like this
'email' => 'required|email|max:255|unique:users,email,15',
For the user with id 15, it works very well, why it is not when using patch?
EDIT: i tried
dd($this->id);
When sending using post and patch and for post is the actual user id, but for PATCH it returns null
Here are my create and edit forms
http://laravel.io/bin/BLGeN