Code for Laravel + ButterCMS blog tutorial.
This project was created as an example use case of ButterCMS in conjunction with a blog article, How to Build a Blog with Laravel (& Send Slack Notifications), and will not be actively maintained.
If you’re interested in exploring the best, most up-to-date way to integrate Butter into PhP frameworks like Laravel, you can check out the following resources:
The following turn-key starters are fully integrated 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.
- Laravel Starter
- Angular Starter
- React Starter
- Vue.js Starter
- Or see a list of all our currently-maintained starters. (Over a dozen and counting!)
- Check out the official ButterCMS Docs
- Check out the official ButterCMS API docs
After cloning this repository, run the following command to install dependencies:
composer install
Rename .env.example
to .env
:
mv .env.example .env
Then, add your ButterCMS API token and Slack Webhook URL:
BUTTER_API_KEY=
SLACK_WEBHOOK=
You also need to add an absolute path to your SQLite database:
DB_DATABASE=/path/to/butter-blog/database/database.sqlite
You can easily create an SQLite database with the following command:
touch database/database.sqlite
You then need to migrate the database tables:
php artisan migrate
And seed to add a fake user:
php artisan db:seed
Finally, you can run the server with the following command:
php artisan serve
This will by default run the server at localhost:8000
.