We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please, can we add when() method for conditional clause to make code more readable/concise. https://laravel.com/docs/8.x/queries#conditional-clauses
when()
I saw a code somewhere:
const query = User.page(params.page || 1) .include('avatar') .orderBy(params.sort) if (params.search) { query.where('search', params.search) } const result = await query.params({ limit: 20 }).get()
Would be re-written to:
const result = await User.page(params.page || 1) .include('avatar') .orderBy(params.sort) .when(params.search, (query, search) => query.where('search', search)) .params({ limit: 20 }) .get()
The text was updated successfully, but these errors were encountered:
8f08c8f
🎉 This issue has been resolved in version 1.10.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
Sorry, something went wrong.
No branches or pull requests
Please, can we add
when()
method for conditional clause to make code more readable/concise.https://laravel.com/docs/8.x/queries#conditional-clauses
I saw a code somewhere:
Would be re-written to:
The text was updated successfully, but these errors were encountered: