import formatSlug from "@/utils/formatSlug"; import type { CollectionConfig } from "payload"; export const BlogCategories: CollectionConfig = { slug: "blogCategories", labels: { plural: "Categories", singular: "Category" }, fields: [ { name: "name", type: "text", required: true, }, { name: "slug", type: "text", admin: { position: "sidebar", }, hooks: { beforeValidate: [formatSlug("title")], }, }, ], admin: { hideAPIURL: true, group: "Blogs", }, };