This Laravel starter project fully integrates with dynamic sample content from your ButterCMS account, including main menu, pages, blog posts, categories, and tags, all with a beautiful, custom theme with already-implemented search functionality. All of the included sample content is automatically created in your account dashboard when you sign up for a free trial of ButterCMS.
You can view a live demo hosted on Heroku, or you can click the button below to deploy your own copy of our starter project to the provider of your choice.
This project requires:
- PHP 8.1+
- Composer 2.3.5+
sudo apt update sudo apt install php8.1 php8.1-mbstring php8.1-xml php8.1-curl php8.1-zip
sudo apt install composer
brew install php@8.1
brew install composer
Then, clone the repo and install the dependencies:
git clone https://github.com/ButterCMS/laravel-starter-buttercms
cd laravel-starter-buttercms
composer install
To fetch your ButterCMS content, open .env file that was created during "composer install" and add your API token as an environment variable.
To view the app in the browser, you'll need to run the local development server:
php artisan serve
Congratulations! Your starter project is now live at http://localhost:8000/.
Our starter app can be deployed to Heroku with the click of a button:
- Create a Heroku account at https://signup.heroku.com.
- Click the button below and fill in an app name and your Butter API token. Then click "deploy".
By default, your starter project is set up to allow previewing of draft changes saved in your ButterCMS.com account. To disable this functionality, set the following value in your .env file: LARAVEL_APP_BUTTER_CMS_PREVIEW=false
If you are sure your PHP and Composer versions are correct, you can try the following:
If you encounter errors after installation:
# Clear application caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
# Regenerate autoloader files
composer dump-autoload
This project uses ButterCMS version 3.1.0. For documentation and API references, visit ButterCMS PHP API docs.