WordPress-style post types for Laravel. Define news, events or pages fluently, and get admin pages, public archives and permalinks for each.
- Post types with labels, features (content, excerpt, media, meta, author, scheduling), taxonomies, statuses and scheduling.
- Meta fields with javaabu/meta, media with javaabu/mediapicker, content with javaabu/block-editor.
- Admin pages from
Route::postTypesAdmin()with javaabu/filters and javaabu/bulk-actions, in Blade or Inertia React. - Public archives, term archives and single pages from
Route::postTypes(), with configurable permalinks and overridable templates. - Permissions per post type through javaabu/permissions, for any guard and user model.
- Dhivehi and RTL; optional translations with javaabu/translatable.
use Javaabu\PostTypes\Facades\PostTypes;
use Javaabu\PostTypes\PostType;
use Javaabu\PostTypes\Taxonomy;
use Javaabu\Stencil\Fields\TextInput;
// AppServiceProvider::boot()
PostTypes::taxonomy(Taxonomy::make('categories')->hierarchical());
PostTypes::register(
PostType::make('news')
->labels('News article', 'News')
->supports(['content', 'excerpt', 'media', 'meta'])
->taxonomies(['categories'])
->metaFields([TextInput::make('subtitle')])
->permalink('{year}/{month}/{slug}')
);
// routes/web.php
Route::postTypesAdmin(['guard' => 'web_admin', 'prefix' => 'admin', 'name' => 'admin.']);
Route::postTypes();See the docs, or llms.txt for AI assistants.
The MIT License (MIT). See License File.