Requirements

Before getting started, make sure you have installed PHP 8.3+, Node.js 21+, Nginx or Apache server, and (optionally) one of the supported database services: SQLite 3.26+, MySQL 5.7+, PostgreSQL 10.0+, MariaDB 10.3+ or SQL Server 2017+.
You should also have Composer (dependency manager for PHP) installed.

Laravel Herd

Laravel Herd is highly recommended local development tool for Laravel. It’s very simple to setup and it provides all of the requirements to run (and much more).
It’s available for MacOS and Windows.

Docker

Instructions coming soon…

Setup

Open your terminal, and run those commands to get started.

Clone the repository

git clone [email protected]:kratos-digital-org/butchr-boilerplate.git YOUR_APP_NAME
cd YOUR_APP_NAME

Stay in sync with upstream repo

Use those instructions if you want to keep version control and track future updates in main repository.

Check remotes

git remote -v

You should see this output:

origin [email protected]:kratos-digital-org/butchr-boilerplate.git (fetch)
origin [email protected]:kratos-digital-org/butchr-boilerplate.git (push)

Update origin remote

git remote set-url origin YOUR_NEW_REPOSITORY

Add upstream remote

git remote add upstream [email protected]:kratos-digital-org/butchr-boilerplate.git

Verify remotes again

git remote -v

You should now see this output:

origin YOUR_NEW_REPOSITORY (fetch)
origin YOUR_NEW_REPOSITORY (push)
upstream [email protected]:kratos-digital-org/butchr-boilerplate.git (fetch)
upstream [email protected]:kratos-digital-org/butchr-boilerplate.git (push)

Fetch updates from upstream

git fetch upstream
git merge upstream/main

Add, commit and push as usual

git add .
git commit -m "Your commit message"
git push -u origin main # or whatever branch you use

Standalone project

Use those instructions if you want to treat your project as an independent repository without any version control and future updates.

All future updates you will need to handle manually.

Remove current git repo

rm -rf .git

Initialize a new git repo

git init

Commit all files

git add .
git commit -m "Your commit message"

Create remote repo

git remote add origin YOUR_NEW_REPOSITORY

Push your changes

git push -u origin main # or whatever branch you use

Create environment file

After you have setup your git repository, continue with the app setup by creating an environment file.

cp .env.example .env

Setup database credentials

By default, is using SQLite as database connection.

To change database name (default is database.sqlite) set the variable in your .env. Make sure to enter the absolute path, not just the database name.

DB_DATABASE="/code/butchr/database/butchr.sqlite"

If you want to use the default one (database.sqlite), just comment or remove the variable in your .env file

#DB_DATABASE=

To use different database connection, feel free to update the variables accordingly.
This is example for MySQL connection, but you can use any of the supported database services.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=butchr
DB_USERNAME=root
DB_PASSWORD=

Quick installation

Once you have setup your .env file, run this command and follow the steps.

composer install && php artisan app:init

Quick installation will run all the commands under Manual setup so you can skip the manual setup all together when using quick installation.

You will probably want to implement your payment plans, so I recommend to generate your plans right after the installation.

Go to Generate products and follow the docs. You can also visit Payment settings to adjust your checkout pages.

Manual setup

Generate application key

php artisan key:generate

Install PHP packages

composer install

Install JS packages

npm ci

Enable public access to storage folder

php artisan storage:link

Build CSS and JS

npm run dev

Run local server

If you use Laravel Herd you don’t need to run local server since Herd will create a local domain for your application.

Open new terminal tab or window and start your app.

php artisan serve

Visit http://127.0.0.1:8000/ and see your application.

Before using the application, you should run migrations to create your database (and seeders to have some data to work with).