Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Added the possibility to define custom attributes's names on models #213

Merged
merged 4 commits into from
Sep 7, 2015

Conversation

ricardoriogo
Copy link
Contributor

Added the possibility to define the last argument of Illuminate\Validation\Validator constructor method.

@goldysingh
Copy link

This would be extremely useful.

@@ -517,6 +524,7 @@ public function validate(array $rules = array(), array $customMessages = array()
$success = true;
} else {
$customMessages = (empty($customMessages))? static::$customMessages : $customMessages;
$customAttributes = (empty($customAttributes))? static::$customAttributes : $customAttributes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's this variable coming from? $customMessages is an argument but the new one is not. Please include it in the method signatures if it makes sense (I guess it does although I'm no Laravel expert) or simply remove this check altogether and use static::$customAttributes directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. $customAttributes parameter included!

Added ``$customAttributes`` on ``Ardent::validate()`` signature.
@marvinschroeder
Copy link

+1
would be great!

@moura137
Copy link

+1
I am also in need of this change, please would be great!
would be great!

@fdammassa
Copy link

+1
Very useful!

@victorleal
Copy link

+1
would be great!

@sisou
Copy link

sisou commented Aug 29, 2015

@igorsantos07 bump

If the PR removes/discards the README.md file changes, then I think this can be safely merged?

@ricardoriogo
Copy link
Contributor Author

Can be merged now

@igorsantos07
Copy link
Member

Sorry for taking so long. I've said something "apologising" at #275.

I'm not sure if this would be the best approach but I doesn't seem bad either. I guess you all are better on verifying this than myself, for not using Laravel currently, neither the project.

Thanks @ricardoriogo for the code and @sisou for the tip!

igorsantos07 added a commit that referenced this pull request Sep 7, 2015
Added the possibility to define custom attributes's names on models
@igorsantos07 igorsantos07 merged commit c655360 into laravel-ardent:master Sep 7, 2015
@igorsantos07
Copy link
Member

For those interested, I have no time to organize a new release now, but you can use the commit as a means of locking a version. I guess you should define the version as dev-master#c655360, if my memory is still of any good. If not... look at the Composer docs :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants