Skip to content
This repository was archived by the owner on Oct 19, 2019. It is now read-only.

azdanov/laravel-animals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Animals · PRs Welcome GitHub license

Building a small shop with an admin panel made with Vue. This is an Hybrid app with parts made in plain HTML and others in Vue where SEO is not required.

Live

Main User Admin
animals test_ animals test_user_cart animals test_admin_categories_cats
animals test_pets animals test_user_cart (1) animals test_admin_orders

Getting started

Use Homestead or Valet.

Dependencies

Services

These services are required for using the payment functionality in this demo.

Installing

Composer and Yarn are required to install and bundle the dependencies.

composer install

cp .env.example .env

# set BRAINTREE_ENV=sandbox
# set BRAINTREE_PRIVATE_KEY=<key>
# set BRAINTREE_PUBLIC_KEY=<key>
# set BRAINTREE_MERCHANT_ID=<key>
# set DB_CONNECTION=sqlite
# set DB_HOST=127.0.0.1
# set DB_PORT=3306
# set DB_DATABASE="/Users/me/projects/animals/database/animals.sqlite"
# set DB_USERNAME=root
# set DB_PASSWORD=

touch database/animals.sqlite

php artisan key:generate
php artisan migrate
php artisan passport:install
php artisan db:seed

yarn
yarn dev

Deployment on Heroku

The demo can be hosted on Heroku in such a way.

For this example the demo is named: laravel-animals.

  1. Install Heroku-CLI
  2. Provision Heroku add-ons and build-packs:
    heroku apps:create laravel-animals
    heroku addons:create heroku-postgresql:hobby-dev --app laravel-animals
    heroku buildpacks:add heroku/php --app laravel-animals
    heroku buildpacks:add heroku/nodejs --app laravel-animals
  3. Add Heroku to git remote:
    heroku git:remote --app laravel-animals
  4. Set environmental variables on Heroku:
    heroku config:set --app laravel-animals APP_KEY=$(php artisan --no-ansi key:generate --show)
    heroku config:set --app laravel-animals APP_URL=$(heroku info -s | grep web_url | cut -d= -f2)
    heroku config:set --app laravel-animals MIX_APP_URL=$(heroku info -s | grep web_url | cut -d= -f2 | sed "s/\$/api/g")
    heroku config:set --app laravel-animals NPM_CONFIG_PRODUCTION=false
    heroku config:set --app laravel-animals APP_IMAGE_PATH=images
    heroku config:set --app laravel-animals FILESYSTEM_DRIVER=heroku
    heroku config:set --app laravel-animals BRAINTREE_ENVIRONMENT=sandbox
    heroku config:set --app laravel-animals BRAINTREE_MERCHANT_ID=<id>
    heroku config:set --app laravel-animals BRAINTREE_PUBLIC_KEY=<key>
    heroku config:set --app laravel-animals BRAINTREE_PRIVATE_KEY=<key>
  5. Deploy to Heroku
    git push heroku master
  6. Run demo migrations and optimizations
    heroku run -a laravel-animals php artisan migrate
    heroku run -a laravel-animals php artisan db:seed
    heroku run -a laravel-animals php artisan config:cache
    heroku run -a laravel-animals php artisan route:cache
  7. Enable debugging (Optional, be sure not to run this on production, and prune telescope entries regularly)
    heroku config:set --app laravel-animals 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, etc).

License

MIT

About

A small Laravel, Vue and Braintree shop.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published