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
Currently I will write method chaining like this:
final class User { public function scopeAuthor(Builder $query): Builder { return $query->whereIn("status", [ User::STATUS_SUSPENDED, User::STATUS_BANNED, ]) ->where("active", true) ->whereHas("books"); } }
I know I was writing the methods chaining like this a while ago
final class User extends Model { public function scopeAuthor(Builder $query): Builder { return $query->whereIn("status", [ User::STATUS_SUSPENDED, User::STATUS_BANNED, ]) ->where("active", true) ->whereHas("books"); } }
I've seen on Twitter people use a trick when the first method call is multiline
final class User { public function scopeAuthor(Builder $query): Builder { return $query->new() ->whereIn("status", [ User::STATUS_SUSPENDED, User::STATUS_BANNED, ]) ->where("active", true) ->whereHas("books"); } }
Maybe it's worth considering adding a word about it.
The text was updated successfully, but these errors were encountered:
the first and second versions are identical👯
Sorry, something went wrong.
Pay attention to spaces 😜
Related to #16
#16 resolves this by requiring the first method be placed on the next line when breaking chained function calls across multiple lines.
No branches or pull requests
Currently I will write method chaining like this:
I know I was writing the methods chaining like this a while ago
I've seen on Twitter people use a trick when the first method call is multiline
Maybe it's worth considering adding a word about it.
The text was updated successfully, but these errors were encountered: