jan-vince / smallrecords

OctoberCMS plugin to store and manage records and lists
MIT License
30 stars 11 forks source link

Add short alias for isActive scope #80

Closed dreamboostme closed 3 years ago

dreamboostme commented 3 years ago

Concise, convenient, with the ability to return an inverted result.

Name active for this scope mentioned in OctoberCMS documentation: https://octobercms.com/docs/database/model#query-scopes

This short name is also often found in the implementation of models of other plugins.

Record::active()->paginate(12);

You can also invert the result by passing FALSE. What for? I don’t know, but why not =)

Record::active(false)->paginate(12);