Skip to content
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

[REQUEST] Bringing dynamic wheres back #241

Closed
mitchellvanw opened this issue Feb 2, 2013 · 1 comment
Closed

[REQUEST] Bringing dynamic wheres back #241

mitchellvanw opened this issue Feb 2, 2013 · 1 comment

Comments

@mitchellvanw
Copy link
Contributor

I really really (really) like the idea of having dynamic wheres back in #L4.
It makes your code look a bit more clearer in my opinion.
Since we are following the PSR standards, it'd be cool if it was camelCase, instead of the snake_case one.

$user = User::whereName($name)->first();

I'm not sure if this was already in the making, but it would be awesome if this was available.

Anyone else missing this?

@JoostK
Copy link
Contributor

JoostK commented Feb 3, 2013

It has been proposed before, but is not implemented because of the conversion from camelCase back to snake_case (which is of course possible). However, in L4 it is possible to dismiss the second parameter (the comparator) so you can now use:

$user = User::where('name', $name)->first();

Which I think is just as nice to look at and it's clearer which column is actually involved, because there is no conversion going on.

joelharkes added a commit to joelharkes/framework_old that referenced this issue Mar 7, 2019
gonzalom pushed a commit to Hydrane/tmp-laravel-framework that referenced this issue Oct 12, 2023
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

No branches or pull requests

3 participants