#Why is Model::increment() protected?
4 messages · Page 1 of 1 (latest)
4 messages · Page 1 of 1 (latest)
Illuminate\Database\Eloquent\Model’s increment() method is protected. When I call ->increment() on a model my IDE will warn me that it is a protected method, but the call does in fact increment the value in the given column.
Is this an oversight? Should this method simply be public? Why does it work despite it being protected?
Technically your call is being proxied to the underlying query builder and not actually using the increment method on the model
Cool, so that means my IDE is just confused, but the increment method on the query builder is totally valid?
Yeah