TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Ahondev/portfolio-v2/llms.txt
Use this file to discover all available pages before exploring further.
PostType builder provides a fluent, declarative API for registering WordPress custom post types together with their ACF Extended field groups, taxonomies, and Eloquent model bindings — all in one place. Every call to PostType::create() immediately registers the post type with WordPress and adds it to the EloquentManager model registry. Calling ->make() at the end of the chain finalises the ACF field group.
PostType::create()
The static factory that starts the builder chain. It calls register_post_type() internally and throws wp_die() if the slug is already taken.
The WordPress post type slug, e.g.
'article'. Must be unique; calling create() with an existing slug triggers wp_die().Singular label for the post type, displayed in the WordPress admin.
Plural label used as the admin menu item name.
The URL slug for the post type’s rewrite rule, e.g.
'blog' produces /blog/{slug} permalinks.A Dashicons identifier without the
dashicons- prefix, e.g. 'hammer' renders the dashicons-hammer icon in the admin sidebar.When
true, the SEOServiceProvider automatically attaches the shared ACF SEO field group (title, description, keywords, OG image, author) to this post type and includes it in the SEO dashboard score calculation.The
EloquentCPT subclass name that will be generated in app/PostTypes/. Defaults to 'undefined', which causes the slug to be used as the class name. Pass an explicit PascalCase name when you want a custom file name, e.g. 'Article'.Chainable Methods
->taxonomy()
Register a WordPress taxonomy attached to this post type. Optionally include ACF Extended fields scoped to the taxonomy.
The taxonomy slug, e.g.
'category'.Singular label.
Plural label shown in the admin.
URL slug for taxonomy archive pages.
Whether to expose this taxonomy through the WordPress REST API.
An optional array of ACF Extended field objects. When provided, a field group scoped to this taxonomy is registered automatically.
->fields()
Append ACF Extended field objects to this post type’s field group. You can call ->fields() multiple times — fields are merged.
An array of ACF Extended field objects such as
Text::make(), Repeater::make(), WYSIWYGEditor::make(), etc.->make()
Finalises the configuration by calling register_extended_field_group(). Must be the last call in the chain. Omitting ->make() means no ACF field group is created.
Static Methods
PostType::all()
Returns an associative array of all PostType instances registered during the current request, keyed by slug. Used by SEOServiceProvider and RoutingServiceProvider to iterate over registered types.
PostType::init()
Loaded by the Kernel at init priority 20. Requires configuration/posts.php, which in turn requires each individual post-type definition file.
Example: Article Post Type
A minimal post type with a taxonomy, a WYSIWYG body field, and SEO enabled.Example: Service Post Type
A complex post type showing every available field type —Text, Textarea, WYSIWYGEditor, Image, URL, Select, and Repeater.
Registration File
Theconfiguration/posts.php file acts as the manifest that requires individual post-type definition files.
WordPress Post Type Options
ThecreatePostType() method registers all post types with the following fixed WordPress options:
| Option | Value |
|---|---|
public | true |
show_in_rest | false (REST access goes through ApiRouter, not WP REST) |
show_ui | true |
capability_type | 'post' |
supports | ['title'] |
rewrite.with_front | false |