How do you construct with Laravel the backend of a headless CMS?
What is Headless CMS
A headless CMS (Content Management System) has a web interface only for creating content but no web interface for showing content to the audience.
The advantage of a headless CMS is that you do not impose a particular way of content display. So you are free to construct your SPA (Single Page Application) to display content.
After years of using different CMS, we expect that creating content and displaying content through a CMS, whether headless or not, has to support certain activities.
Writing
Pieces of content, such as articles, are written and rewritten over hours or days. An author seldom publishes a piece of content in the same session in which he/she started to compose it.
Consequently, the backend of a CMS has to store and update drafts before publishing content.
Approval
An enterprise-grade CMS requires a flow of approval for each piece of content. So an article is written, reviewed, and then approved.
The backend of a CMS has to implement such an approval workflow.
Comments
Once the content is displayed, we expect readers to comment on each piece of content and to comment on comments.
So the backend of a CMS has to store threads of comments.
Laravel Packages to Do the Job
One should consider that pieces of content can come from different types of models in the same CMS, such as articles, posts, and pages.
We would use the following packages:
- Laravel Drafts - do manage drafts and revisions
- Laravel Comments - store comments on models
- Approval - approve a model before it is persisted
Top comments (0)