'Channel List', 'description' => 'Displays a list of feed channels.' ]; } public function defineProperties() { return [ 'includeEmpty' => [ 'title' => 'Include Empty?', 'description' => 'Include channels with no posts?', 'type' => 'checkbox', 'default' => true ] ]; } public function onRun() { $this->page['channels'] = Channels::orderBy('id')->withCount('feeditems')->get(); // If applicable, remove empty channels if (!$this->property('includeEmpty')) { foreach($this->page['channels'] as $key => $value) { if (!$value->feeditems_count) unset($this->page['channels'][$key]); } } } }