Exploring Laravel by building a simple BREAD website. Live.
Read how to setup Docker / Homestead.
Or use Valet and locally installed dependencies.
These services are required for using the searching and payment functionality in this demo.
Composer and Yarn are required to install and bundle the dependencies.
By default sqlite
is enabled in the .env
for a faster start in development.
Similarly redis
is disabled for queues, session, etc.
composer install
cp .env.example .env
touch database/db.sqlite
php artisan key:generate
php artisan migrate
php artisan db:seed
yarn
yarn dev
The demo can be hosted on Heroku in such a way.
For this example the demo is named: my_demo_name
.
- Install Heroku-CLI
- Provision Heroku add-ons and build-packs:
heroku apps:create my_demo_name heroku addons:create heroku-postgresql:hobby-dev --app my_demo_name heroku addons:create heroku-redis:hobby-dev --app my_demo_name heroku buildpacks:add heroku/php --app my_demo_name heroku buildpacks:add heroku/nodejs --app my_demo_name
- Add Heroku to git remote:
heroku git:remote --app $app_name
- Set environmental variables on Heroku:
heroku config:set --app my_demo_name APP_KEY=$(php artisan --no-ansi key:generate --show) heroku config:set --app my_demo_name QUEUE_CONNECTION=redis SESSION_DRIVER=redis CACHE_DRIVER=redis SCOUT_QUEUE=true heroku config:set --app my_demo_name BRAINTREE_ENVIRONMENT=sandbox heroku config:set --app my_demo_name BRAINTREE_MERCHANT_ID=<id> heroku config:set --app my_demo_name BRAINTREE_PUBLIC_KEY=<key> heroku config:set --app my_demo_name BRAINTREE_PRIVATE_KEY=<key> heroku config:set --app my_demo_name ALGOLIA_APP_ID=<id> heroku config:set --app my_demo_name ALGOLIA_SECRET=<secret> heroku config:set --app my_demo_name MIX_ALGOLIA_CLIENT_ID=<id> heroku config:set --app my_demo_name MIX_ALGOLIA_CLIENT_KEY=<key> heroku config:set --app my_demo_name MIX_ALGOLIA_CLIENT_INDEX=<index>
- Deploy to Heroku
git push heroku master
- Run demo migrations
heroku run -a my_demo_name php artisan migrate heroku run -a my_demo_name php artisan db:seed
- Enable debugging (Optional, be sure not to run this on production, and prune telescope entries regularly)
heroku config:set --app my_demo_name APP_ENV=development APP_DEBUG=true APP_LOG_LEVEL=debug TELESCOPE_ENABLED=true
Any issues during deployment are usually because of wrong env variables for external services (redis, postgres, braintree, algolia, algolia client).