for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
* Class UpdateUserRequest.
* @author Mahmoud Zalt <[email protected]>
class UpdateUserRequest extends Request
* Define which Roles and/or Permissions has access to this request.
* @var array
protected $access = [
'permissions' => 'update-users',
'roles' => '',
* Id's that needs decoding before applying the validation rules.
protected $decode = [
* Defining the URL parameters (`/stores/999/items`) allows applying
* validation rules on them and allows accessing them like request data.
protected $urlParameters = [
* @return array
public function rules()
'email' => 'email|unique:users,email',
'id' => 'required|exists:users,id',
'password' => 'min:6|max:40',
'name' => 'min:2|max:50',
* @return bool
public function authorize()
// is this an admin who has access to permission `update-users`
// or the user is updating his own object (is the owner).