-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass variable from controller to $rules #70
Comments
you can do it like this public function setTenantIdAttribute($value){
$this->rules['username'] = 'required|unique:users,username,NULL,id,tenant_id,' . $value;
$this->attributes['entity_id'] = $value;
} |
I can see the need for there to be a better solution than this, I'll take a look into it for a future version. |
Nice solution @nicolaslopezj! Didn't think of using setAttribute.. Thanks! |
How to display Custom Message for Rule I have added in Model like
But Custom Message is not display Can Help me?? |
The property is '$validationMessages', I believe. |
Thanks For Reply I have Tried , but cant get Custom Message protected $validationMessages = [ Any Idea ?? |
Oh sorry, it looks like that feature was removed from the Laravel 5 branch. Please create a new issue for that, as it is different to the topic of this issue. |
How would one pass a value from my controller to the model and $rules attribute like below?
The following works in the controller, but replaces the entire rules set in the model (and is not as flexible)
The text was updated successfully, but these errors were encountered: