A Laravel CMS like no other

Meet the headless Laravel CMS that integrates with your app using a straightforward API. Smooth, simple, and tasty content integration — that’s Butter.

Posted on July 25, 2024

Intuitive admin interface

So easy to use. So easy to customize. You’re going to love the content you build better with ButterCMS.

Handy integration with Laravel

Our Laravel CMS has a simple content API and drop-in Laravel SDK that makes the magic happen in minutes, not hours.

A truly zero-maintenance solution

With ButterCMS, you’ll never worry about security upgrades, hosting, or performance again.

Powerful CMS for Laravel. Zero headache.

Drop our API-based CMS into your Laravel app in minutes. 

ButterCMS provides a component-based CMS and content API for Laravel apps. Use ButterCMS to enable dynamic content in your apps for page content, blogs, and anything else. Most customers get our Laravel CMS set up in one hour or less. 

That leaves plenty of time for you and your marketing team to do what you do best: create killer apps with killer content. 

Play video

See how Butter’s API enables you to compose flexible page layouts and easily reorder components, without a developer.

G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award G2 crowd review award

“Best CMS on the market”

headshot of Hampton Catl

After shopping the market, it was clear that ButterCMS was the perfect choice. It allows our developers to build powerful components and makes it easy for our marketing team to drive a better customer experience. Hampton Catlin Creator of Sass and Haml

Deploy our Laravel Starter in 30 Seconds!

Or follow the below commands to clone a copy of the repo from github, install dependencies, set your free Butter token, and run your local server on localhost:8000/.

$ git clone https://github.com/ButterCMS/larvel-starter-buttercms
$ cd laravel-starter-buttercms
$ composer install
$ echo 'LARAVEL_APP_BUTTER_CMS_API_KEY=your_free_api_token_here' >> .env
$ php artisan serve

Built to make content marketing easy

ButterCMS is the best headless cms for Laravel for a simple reason: Laravel developers can build solutions that marketing people love. Our API allows your content gurus to quickly spin up high-converting, dynamic landing pages, SEO pages, product marketing pages, and more, all using simple drag-and-drop functionality.

  • SEO landing pages
  • Customer case studies
  • Company news & updates
  • Events + webinar pages
  • Education center
  • Location pages
  • And more...

The simplest Laravel CMS you'll find

Our simple setup saves you time and money. Take us for a spin to see for yourself!

headshot of LUKE GARDNER

It's the epitome of plug-and-play simplicity for content creators. It does exactly what I need it to. LUKE GARDNER, CONTENT SPECIALIST, PRINTAVO

Fast integration with any Laravel app

Our mission was to make it easy to integrate Butter with your existing Laravel app in minutes. It’s so simple! To demonstrate, here’s a mini tutorial to give you a feel for the process of adding marketing pages to your Laravel app.

Of course, you can also use our Collections to do advanced content modeling. For a full integration guide, check out our Official Guide for the ButterCMS Laravel API client.

Play video

See how easily you can integrate the ButterCMS Pages API with your Laravel app.

Seamless Laravel components

Empower your marketing team with dynamic landing pages that align perfectly with your Laravel components. 

Components are the essential building blocks of any Laravel app, and ButterCMS handles them with ease. 

Our drag and drop interface makes it simple to structure your content to match existing Laravel components and to create new reusable components whenever you need them.

One Laravel CMS with everything you need

There’s a reason so many developers are choosing a headless Laravel CMS. It’s easy to set up, offers flexible, customizable content modeling, and gives you access to our full Laravel API.

  • Custom page types
  • Custom content modeling
  • CDN for assets
  • Webhooks
  • Testing environment
  • Customer case studies
  • Location pages

ButterCMS saves you development time

Most customers get our Laravel CMS up and running in less than an hour. Try it yourself!

headshot of DILLON BURNS

Simple as can be, with powerful features and great customer support. DILLON BURNS, FRONT END DEVELOPER, KEYME

How to integrate ButterCMS into your Laravel application

Just follow the simple steps below to complete the integration and begin creating pages with Butter. Be sure to check out our full guide to creating pages using the ButterCMS Laravel API.

First you would set up a new Customer Case Study page type in Butter and create a page. With your page defined, the ButterCMS API will return it in JSON format like this:

{
    "data": {
        "slug": "acme-co",
        "fields": {
            "facebook_open_graph_title": "Acme Co loves ButterCMS",
            "seo_title": "Acme Co Customer Case Study",
            "headline": "Acme Co saved 200% on Anvil costs with ButterCMS",
            "testimonial": "<p>We've been able to make anvils faster than ever before! - <em>Chief Anvil Maker</em></p>\r\n<p><img src=\"https://cdn.buttercms.com/NiA3IIP3Ssurz5eNJ15a\" alt=\"\" caption=\"false\" width=\"249\" height=\"249\" /></p>",
            "customer_logo": "https://cdn.buttercms.com/c8oSTGcwQDC5I58km5WV",
        }
    }
}

To create these pages in our app, we create a dynamic route that fetches content for the page by using a URL parameter. Here's what the routes/web.php looks like:

Route::get('/customers/{slug}', 'CustomerController@showCustomer');

Here's what the app/Http/Controllers/CustomerController.php looks like:

<?php

namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Response as Response;
use ButterCMS\ButterCMS;

class CustomerController extends BaseController {

  private static $apiToken = 'your_api_token';
  private $client;

  public function __construct() {
    $this->client = new ButterCMS(CustomerController::$apiToken);
  }

  public function showCustomer(string $slug) {
    $page = $this->client->fetchPage('customer_case_study', $slug);
    return view('customer', [
      'seoTitle' => $page->getField('seo_title'),
      'facebookTitle' => $page->getField('facebook_open_graph_title'),
      'headline' => $page->getField('headline'),
      'customerLogo' => $page->getField('customer_logo'),
      'testimonial' => $page->getField('testimonial'),
    ]);
  }

}

Here's what the resources/views/customer.blade.php looks like:

<html>
  <head>
    <title>{{$seoTitle}}</title>
    <meta property="og:title" content="{{$facebookTitle}}" /> 
  </head>
  <body>
    <h1>{{$headline}}</h1>
    <img width="100%" src="{{$customerLogo}}">
    <p>{{$testimonial}}</p>
  </body>
</html>

That's it! If you browse to your homepage you'll see your homepage populated with the content you created in Butter.

Get Started for Free

The benefits of going headless with Laravel

Laravel’s design philosophies and features make it an excellent choice for building headless applications. Here’s how some of its defining characteristics contribute to a successful headless setup:

Modular design and dependency injection for enhanced maintainability

Laravel's modular design features services like repositories and dependency injection that promote a clean codebase. Since headless architectures rely heavily on APIs, having well-defined modules with clear dependencies makes it easier to maintain, update, and scale individual components without affecting the entire application.

Laravel CMS modular components

Powerful routing for flexible API endpoints

In a headless setup, you often need to serve content to multiple frontend clients with distinct needs. Laravel's flexible PHP-based routing system enables you to easily handle this challenge. Features like verb-based routing, route groups, and route parameters and wildcards allow you to create clean, readable, and efficient routes that scale well and are conducive to change.  

Robust middleware support

The Laravel middleware can filter and process HTTP requests before they reach your controllers. This built-in feature is particularly useful in headless setups to handle tasks such as authentication, logging, and data transformation. For example, you can use the middleware to transform product data from a third-party API into a compatible format before passing it to the controller that handles the product catalog.

Eloquent ORM simplifies content management at scale

Laravel's Eloquent Object-Relational Mapper acts as a bridge between your headless application and the database. Instead of writing complex SQL queries for each content model (like blogs, articles, or promotions), developers can use expressive PHP code to manage data retrieval and manipulation, which frees them to focus on more complex business logic and application development.

Laravel Horizon for asynchronous processing 

Another core Laravel feature that comes in handy in a headless setup is Laravel Horizon,  a modern queue management system that allows for asynchronous processing of queues, jobs, and tasks. With Horizon, you can decouple your Laravel headless CMS application into smaller independent tasks that process more efficiently in the background. For example, you could use Horizon to process large data sets, send email notifications, or generate exports.

ButterCMS, the ideal CMS for Laravel

Laravel and ButterCMS are a match made in headless heaven. Here's why ButterCMS is the best CMS for Laravel:

ButterCMS is just as developer-friendly as Laravel

Both Laravel and ButterCMS are built with developers in mind. Laravel’s elegant syntax, comprehensive documentation, and native features make it a favorite among developers. Similarly, ButterCMS offers webhooks, an API explorer, client libraries, and starter kits to simplify development and integration. 

A group of developers holding a Laravel logo

Composability meets modularity

ButterCMS's component-based approach to content management aligns perfectly with Laravel's modular architecture. Marketers can build reusable content components in ButterCMS via a drag-and-drop interface, and developers can effortlessly integrate them into the Laravel application's modules. This compatibility promotes code organization, maintainability, and a clean separation of concerns.

Laravel and ButterCMS are both scalable by design

Scalability is a decisive factor for modern web applications, and both Laravel and ButterCMS are designed with this in mind. Laravel supports horizontal scaling, queue management, and intelligent caching mechanisms to help your application handle increasing loads. ButterCMS is hosted on SOC3 and ISO-270001-compliant AWS data centers that provide automatic scaling, load balancing, and built-in redundancy. 

Content updates delivered in real time

ButterCMS is a headless Laravel CMS that supports real-time content updates at scale. When combined with Laravel's powerful event broadcasting system, you can deliver instant content changes to your users. This is a handy feature to have for applications that require live updates, such as news portals or social media platforms.

What is the future of Laravel in composable environments?

Laravel has long been a leader in the PHP development world, and its future in composable environments is bright. Here are some emerging trends:

Increasing support for serverless computing

Serverless computing is gaining traction as a way to build applications without worrying about the underlying infrastructure. Laravel is evolving to support this trend with packages like Laravel Vapor and Forge. In the future, we can expect Laravel’s support for serverless computing to become stronger, making it an even more attractive option for building modern, composable applications. 

Rise of the Jamstack

The Jamstack (JavaScript, APIs, and Markup) architecture is gaining traction for its focus on statically generated content and serverless functions. Laravel is an excellent option for building the dynamic API layer that Jamstack applications rely on to deliver fresh content. This synergy paves the way for a future of blazing-fast websites with exceptional developer ergonomics.

Ease of AI and ML integrations

Laravel libraries, such as TensorFlow.js and PHP-ML, can integrate AI and ML capabilities into Laravel applications. With the democratization of generative AI technologies, we can expect a proliferation of similar libraries in the future. These libraries will enable Laravel developers to easily implement sophisticated AI-driven features in headless Laravel CMS setups, like smart personalization, image recognition, and content moderation.

Try Butter free for 14 days

See for yourself what makes Butter the best Laravel CMS out there. Click the button below to sign up for your free 14-day trial.