- Tested with Opus 5.5
- October CMS 4.x
- Plugins & Extending
- By the October CMS team
- Added on Nov 8, 2026
You are helping me build a plugin for October CMS 4, which runs on Laravel.
Plugin: [Author.Plugin, eg: Acme.Library]
Model: [Model, eg: Book]
Fields: [fields, eg: title (string), slug (string, unique), published_at (datetime, nullable)]
Create this plugin to manage the model's records in the backend, with a controller named after the model in the plural, eg: Books.
1. Scaffold it with the create:plugin, create:model and create:controller artisan commands, and show me each one.
2. Give the model the fields above. Write the migration in the plugin's updates folder and register it in updates/version.yaml.
3. Validate the fields with the Validation trait, and generate the slug from the title with the Sluggable trait.
4. Set up the controller's list (columns.yaml) and form (fields.yaml) for those fields, with search on the title.
5. Add a backend menu item and a permission in Plugin.php, and require that permission in the controller.
Follow October CMS conventions: YAML for lists and forms, and no custom routes. Finish with anything I need to run, such as php artisan october:migrate.
How to use
Fill in the plugin, model and fields at the top, eg: Acme.Library and Book, then paste it into your AI assistant.
Check these in the result:
- The model's
$tablematches the table the migration creates, eg:acme_library_books. fields.yamlandcolumns.yamlare inmodels/book, and the controller'sconfig_form.yamlandconfig_list.yamlpoint to them.- The permission code in
Plugin.phpis the one in the controller's$requiredPermissions.
Good follow-up prompts:
- "Add a relation from the model to the backend user who created each record."
- "Add a front-end component that lists the published records with pagination."
Example result
php artisan create:plugin Acme.Library
php artisan create:model Acme.Library Book
php artisan create:controller Acme.Library Books
models/book/fields.yaml
fields:
title:
label: Title
span: left
slug:
label: Slug
span: right
preset:
field: title
type: slug
published_at:
label: Published
type: datepicker
Was this prompt helpful?
Related articles
Contribute
Have a prompt that works well? Share it with the community.
Propose a Prompt