check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'users' => !$this->users ? null : \explode(',', \strval($this->users)) ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'users' => 'nullable|array', 'users.*' => 'required|exists:users,id', ]; } }