alvaro-canepa / oc-trait-scope-frontend
OctoberCMS Frontend scope trait
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/alvaro-canepa/oc-trait-scope-frontend
Requires
This package is auto-updated.
Last update: 2025-09-27 11:15:56 UTC
README
OctoberCMS Frontend scope trait
Installation
Package requires PHP 7.2+ and works with OctoberCMS.
Require the package in your composer.json
:
"require": {
...
"alvaro-canepa/oc-trait-scope-frontend": "~1.0",
},
Usage example
class myModel extend Model { use PlanetaDelEste\Traits\ScopeFrontendTrait; ... } /* * @var array $sort 'column' key must be the model column to sort * 'direction', accepted values: "asc", "desc" */ $sort = [ 'column' => get('sort.column'), 'direction' => get('sort.direction') ]; /* * @var array $filters key => value format, where key was used as column name, * and value as search term. */ $filters = get('filters'); $collection = myModel::frontend($filters, $sort)->get();