'Category profile', 'description' => 'Category profile page component', ]; } public function defineProperties() { return [ 'categorySlug' => [ 'title' => 'Select by category :slug', 'description' => 'Select by category', 'type' => 'string', 'default' => '' ], ]; } public function onRun() { $this->users = $this->getCategoryUsers(); $this->category = $this->getCategory(); } protected function getCategory(){ $cSlug = $this->property('categorySlug'); $category = Category::transWhere('slug', $cSlug, Session::get('rainlab.translate.locale'))->with('users')->first(); return $category; } protected function getCategoryUsers(){ $cSlug = $this->property('categorySlug'); $category = Category::where('slug', $cSlug)->first(); $users = $category->users()->get(); // dd($users); return $users; } }