registerArgument('slug', 'string', 'Category for Active page', true); } public function render() { $slug = $this->arguments['slug']; $category = $this->createCategory($slug); return $category; } protected function createCategory(string $value) { if(substr($value, 0, 1) === '/') { $value = ltrim($value, '/'); if(substr($value, 0, 1) === '_') { $value = ltrim($value, '_'); } $data = explode('/', $value); } return $data[0]; } }