private function createCategory($model) { $category = ArticleCategory::where('slug', '=', $model['slug'])->first(); if (is_null($category)) { $category = ArticleCategory::create($model); } return $category; }
protected function loadCategory() { if (!($categoryId = $this->property('categoryFilter'))) { return null; } if (!($category = ArticleCategoryModel::whereSlug($categoryId)->first())) { return null; } return $category; }