Skip to content

Conversation

deefour
Copy link
Contributor

@deefour deefour commented Feb 6, 2015

Small refactor to actually use firstByAttributes (it is not currently used anywhere in the framework) and expose the method publicly as another available finder.

Small refactor to actually use `firstByAttributes` *(it is not currently used anywhere in the framework)* and expose the method publicly as another available finder.
@deefour deefour changed the title Make Use of firstByAttributes and Expose it Publicly [5.0] ]Make Use of firstByAttributes and Expose it Publicly Feb 6, 2015
@deefour deefour changed the title [5.0] ]Make Use of firstByAttributes and Expose it Publicly [5.0] Make Use of firstByAttributes and Expose it Publicly Feb 6, 2015
@JosephSilber
Copy link
Contributor

On the contrary, this method should have really been deleted for L5.

It was originally created before we got support for array wheres. Now it's just useless cruft.

Compare the two:

$user = User::where($attributes)->first();

$user = User::firstByAttributes($attributes);

The first line is both shorter and more readable.

@deefour
Copy link
Contributor Author

deefour commented Feb 6, 2015

Great, thanks for clarifying.

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

Successfully merging this pull request may close these issues.

2 participants