category->query()->with($with)->get(); } /** * @param string $uuid * @param array $with * @return Category */ public function byUuid(string $uuid, array $with = []): Category { return $this->category->query()->with($with)->where('uuid', $uuid)->get()->first(); } /** * @param string $slug * @param array $with * @return Category */ public function bySlug(string $slug, array $with = []): Category { return $this->category->query()->with($with)->where('slug', $slug)->get()->first(); } }