Top Related Projects
Quick Overview
Statamic is a flat-file content management system (CMS) built on Laravel. It offers a modern, flexible approach to content management without the need for a database, using files and folders to store content and configuration.
Pros
- No database required, making it easy to version control content
- Highly customizable and extendable through Laravel ecosystem
- User-friendly control panel for content editors
- Built-in features like multi-site, localization, and asset management
Cons
- Learning curve for developers unfamiliar with Laravel
- Performance can be slower compared to traditional database-driven CMSs for large sites
- Limited built-in e-commerce capabilities
- Paid license required for commercial use
Code Examples
- Retrieving entries from a collection:
use Statamic\Facades\Entry;
$entries = Entry::query()
->where('collection', 'blog')
->where('published', true)
->orderBy('date', 'desc')
->limit(10)
->get();
- Creating a custom tag:
namespace App\Tags;
use Statamic\Tags\Tags;
class CustomTag extends Tags
{
public function index()
{
return 'Hello from CustomTag!';
}
}
- Modifying the control panel menu:
use Statamic\Facades\CP\Nav;
Nav::extend(function ($nav) {
$nav->create('Custom Item')
->section('Tools')
->route('custom.route')
->icon('icon-custom');
});
Getting Started
- Install Statamic via Composer:
composer create-project statamic/statamic my-site --prefer-dist
- Set up your environment file:
cp .env.example .env
php artisan key:generate
- Start the development server:
php artisan serve
- Visit
http://localhost:8000/cp
to access the control panel and begin building your site.
Competitor Comparisons
Build bespoke content experiences with Craft.
Pros of Craft CMS
- More mature and established project with a larger community
- Offers a robust plugin ecosystem with extensive third-party integrations
- Provides a powerful and flexible content modeling system
Cons of Craft CMS
- Steeper learning curve for developers new to the platform
- Higher licensing costs for commercial projects
- Requires more server resources compared to Statamic
Code Comparison
Craft CMS (Twig template):
{% set entries = craft.entries()
.section('blog')
.limit(10)
.all() %}
{% for entry in entries %}
<h2>{{ entry.title }}</h2>
{{ entry.body }}
{% endfor %}
Statamic (Antlers template):
{{ collection:blog limit="10" }}
<h2>{{ title }}</h2>
{{ content }}
{{ /collection:blog }}
Both CMSs use different templating engines, with Craft using Twig and Statamic using Antlers. Craft's approach is more verbose but offers more flexibility, while Statamic's syntax is more concise and easier to read for simple queries. Craft's content fetching is done through a fluent API, whereas Statamic uses a tag-based system for retrieving and displaying content.
Self-hosted CMS platform based on the Laravel PHP Framework.
Pros of October
- Free and open-source, making it more accessible for developers and small projects
- Larger community and ecosystem, with more plugins and extensions available
- More flexible and customizable, allowing for deeper modifications to the core system
Cons of October
- Less polished and user-friendly interface for content editors
- Steeper learning curve for developers, especially those new to Laravel
- Less frequent updates and potentially slower bug fixes
Code Comparison
October CMS:
public function onRun()
{
$this['posts'] = Post::orderBy('created_at', 'desc')->get();
}
Statamic:
public function index()
{
$posts = Entry::query()->where('collection', 'posts')->get();
return view('posts.index', compact('posts'));
}
Both CMSs use Laravel as their foundation, but their approach to content management differs. October CMS relies more on traditional database-driven models, while Statamic uses a flat-file system by default. This is reflected in their code structure and how they handle content retrieval.
October CMS tends to have more flexibility in terms of database interactions and custom functionality, while Statamic offers a more streamlined approach to content management with its built-in features and Antlers templating language.
Kirby's core application folder
Pros of Kirby
- Flat-file CMS, requiring no database, which simplifies setup and deployment
- More lightweight and faster performance due to its file-based structure
- Highly customizable with a flexible plugin system
Cons of Kirby
- Paid license required for commercial use, unlike Statamic's free open-source version
- Smaller community and ecosystem compared to Statamic
- Less built-in features out of the box, requiring more custom development
Code Comparison
Kirby (PHP):
<?php
return [
'title' => 'My Page',
'text' => 'Hello, World!',
'date' => '2023-04-15'
];
Statamic (PHP/Blade):
---
title: My Page
text: Hello, World!
date: 2023-04-15
---
{{ text }}
Both CMSs use a similar approach for defining page content, but Kirby uses pure PHP arrays while Statamic employs YAML-like front matter. Statamic's syntax is more concise and allows for easier integration of template logic within content files.
Kirby's file-based structure offers simplicity and speed, while Statamic provides a more robust feature set and larger community. The choice between them depends on project requirements, budget constraints, and developer preferences.
Pagekit CMS
Pros of Pagekit
- Free and open-source, allowing for unlimited use and customization
- Lightweight and fast, with a modern and intuitive user interface
- Built-in marketplace for easy extension and theme installation
Cons of Pagekit
- Smaller community and ecosystem compared to Statamic
- Less frequent updates and potentially slower bug fixes
- Limited built-in features, requiring more extensions for advanced functionality
Code Comparison
Pagekit (Vue.js component):
<template>
<div class="uk-margin">
<label class="uk-form-label">{{ 'Title' | trans }}</label>
<div class="uk-form-controls">
<input class="uk-input" v-model="node.title" required>
</div>
</div>
</template>
Statamic (Antlers template):
{{ form:create }}
<div class="mb-4">
<label for="title">{{ trans:strings.title }}</label>
<input type="text" name="title" id="title" value="{{ old:title }}" required>
</div>
{{ /form:create }}
Both CMS platforms use component-based architectures, but Pagekit leverages Vue.js while Statamic uses its proprietary Antlers templating engine. Pagekit's code tends to be more JavaScript-centric, while Statamic's approach is more PHP-oriented with a custom templating syntax.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
About Statamic
Statamic is the flat-first, Laravel + Git powered CMS designed for building beautiful, easy to manage websites.
[!NOTE] This repository contains the code for the core Statamic Composer package, to be installed into an existing Laravel application.
The application repository is where you can find a Laravel application preconfigured with Statamic, which is used when creating a new project via the Statamic CLI tool.
Learning Statamic
Statamic has extensive documentation. We dedicate a significant amount of time and energy every day to improving them, so if something is unclear, feel free to open issues for anything you find confusing or incomplete. We are happy to consider anything you feel will make the docs and CMS better.
Support
We provide official developer support on Statamic Pro projects. Community-driven support is available on GitHub Discussions and in Discord.
Contributing
Thank you for considering contributing to Statamic! We simply ask that you review the contribution guide before you open issues or send pull requests.
Code of Conduct
In order to ensure that the Statamic community is welcoming to all and generally a rad place to belong, please review and abide by the Code of Conduct.
Important Links
Top Related Projects
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot