• Stars
    star
    944
  • Rank 48,415 (Top 1.0 %)
  • Language
    PHP
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for YouTube series on building a Laravel E-Commerce application.

Laravel Ecommerce Example

Laravel Ecommerce Example

Code for YouTube video series: https://www.youtube.com/watch?v=o5PWIuDTgxg&list=PLEhEHUEU3x5oPTli631ZX9cxl6cU_sDaR

Website Demo: https://laravelecommerceexample.ca. The demo has limited permissions. Install locally for full access.

Installation

  1. Clone the repo and cd into it
  2. composer install
  3. Rename or copy .env.example file to .env
  4. php artisan key:generate
  5. Set your database credentials in your .env file
  6. Set your Stripe credentials in your .env file. Specifically STRIPE_KEY and STRIPE_SECRET
  7. Set your Algolia credentials in your .env file. Specifically ALGOLIA_APP_ID and ALGOLIA_SECRET. See this episode.
  8. Set your Braintree credentials in your .env file if you want to use PayPal. Specifically BT_MERCHANT_ID, BT_PUBLIC_KEY, BT_PRIVATE_KEY. See this episode. If you don't, it should still work but won't show the paypal payment at checkout.
  9. Set your APP_URL in your .env file. This is needed for Voyager to correctly resolve asset URLs.
  10. Set ADMIN_PASSWORD in your .env file if you want to specify an admin password. If not, the default password is 'password'
  11. php artisan ecommerce:install. This will migrate the database and run any seeders necessary. See this episode.
  12. npm install
  13. npm run dev
  14. php artisan serve or use Laravel Valet or Laravel Homestead
  15. Visit localhost:8000 in your browser
  16. Visit /admin if you want to access the Voyager admin backend. Admin User/Password: [email protected]/password. Admin Web User/Password: [email protected]/password

Shopping Cart Package

I originally used the Crinsane/LaravelShoppingcart package but it is slow to update to the latest versions of Laravel. I now use hardevine/LaravelShoppingcart which is a forked version that updates quicker.

Windows Users - money_format() issue

The money_format function does not work in Windows. Take a look at this thread. As an alternative, just use the number_format function instead.

  1. In app/helpers.php replace money_format line with return '$'.number_format($price / 100, 2);
  2. In app/Product.php replace money_format line with return '$'.number_format($this->price / 100, 2);
  3. In config/cart.php set the thousand_seperator to an empty string or you might get a 'non well formed numeric value encountered' error. It conflicts with number_format.

Starting from a particular point

If you would like to follow along from a particular point, follow these instructions. I'm going to be starting from my starting point in the first video of the series. You can choose any point by replacing the hash with any particular commit.

  1. Clone the repo and cd into it
  2. git checkout f4f651a8a35ebb2ff38ba15771fd65c93051f942
  3. Follow the rest of the steps above. Instead of php artisan ecommerce:install, migrate and seed the normal way with php artisan migrate --seed

More Repositories

1

gridsome-portfolio-starter

A simple portfolio theme for Gridsome powered by Tailwind CSS v1
Vue
376
star
2

todo-vue

Code for YouTube series on building a Todo App in Vue.js
JavaScript
228
star
3

laravel-movies-example

Code for YouTube series on building a Laravel Movie Application
PHP
225
star
4

laravel-realtime-example

Realtime 🍕 Pizza Order Tracker 🍕 - Laravel, Vue & Pusher
PHP
184
star
5

tailwind-v1-examples

A collection of web pages built in Tailwind CSS v1.x
Vue
99
star
6

app-store-tailwind

Mojave App Store Rebuild with Tailwind CSS, Electron and Vue
JavaScript
97
star
7

tailwindcss-tables

Bootstrap styled tables for Tailwind CSS
JavaScript
96
star
8

tailwind-examples

A collection of web pages built in Tailwind CSS v0.7.4
HTML
96
star
9

vue-components-example

Vue
94
star
10

lc-voting

PHP
74
star
11

laravel-shopping-cart-example

An example Laravel App with Shopping Cart functionality
PHP
58
star
12

laracasts-videogames

Code for Laracasts video series
PHP
57
star
13

todo-laravel

PHP
43
star
14

inertia-example

PHP
36
star
15

laravel-vue-spa

PHP
36
star
16

electron-vue-example

JavaScript
35
star
17

electron-react-example

JavaScript
33
star
18

basic-auth-sentinel

Laravel Basic Authentication with Sentinel with roles
PHP
29
star
19

vue-draggable-with-laravel

Using Vue.Draggable to sort a collection of items and persist them to the database with Laravel
PHP
28
star
20

basic-auth-sentry

Laravel Basic Authentication with Sentry with groups
PHP
27
star
21

todo-react

Code for YouTube series on building a Todo App in React
JavaScript
27
star
22

lc-livewire-examples

PHP
25
star
23

bootstrap-vue-example

Vue
24
star
24

react-dnd-example

JavaScript
22
star
25

disneyplus-clone

Vue
22
star
26

booksql-laravel

PHP
21
star
27

resume-template

HTML
21
star
28

todo-angular

TypeScript
20
star
29

custom-radio-buttons

JavaScript
19
star
30

stripe-elements-with-laravel

Code for YouTube video on using Stripe Elements with Laravel
PHP
19
star
31

nuxt-portfolio-starter

A simple portfolio starter theme for Nuxt.js static sites.
Vue
18
star
32

vue-weather-app

PHP
18
star
33

nuxt-example

JavaScript
16
star
34

ulp-laravel-pdf

PHP
15
star
35

nativescript-vue-example

Vue
14
star
36

laravel-paypal-example

PHP
13
star
37

rn-airlock-example

JavaScript
13
star
38

saber-portfolio-starter

A simple portfolio starter theme for Saber.
Vue
13
star
39

booksql-vue

JavaScript
13
star
40

ionic-vue-example

Vue
13
star
41

adonis-example-todo

JavaScript
12
star
42

vue-apollo-auth-example

Vue
12
star
43

ulp-livewire

PHP
12
star
44

laravel-language-switcher-example

PHP
12
star
45

laravel-ajax-validation-example

PHP
12
star
46

css-grid-example

Example code from css grid youtube video
PHP
11
star
47

alpine-js-example

PHP
11
star
48

vue-fan-animation

Vue
11
star
49

dotfiles

Shell
10
star
50

vuenative-example

Vue
10
star
51

element-vue-example

Vue
10
star
52

vue-airlock-example

Vue
10
star
53

svelte-todo-example

JavaScript
10
star
54

laravel-braintree-example

PHP
9
star
55

quasar-example

JavaScript
9
star
56

gridsome-example

Vue
8
star
57

airlock-example

PHP
8
star
58

laravel-vapor-example

PHP
7
star
59

ulp-laravel-excel

PHP
7
star
60

lc-rn-twitter-clone

JavaScript
7
star
61

lighthouse-tutorial

PHP
7
star
62

ulp-laravel-comments

PHP
6
star
63

ulp-canvas

PHP
6
star
64

lc-laravel-twitter-clone

PHP
6
star
65

ulp-sweetalert

PHP
6
star
66

nuxt-static-example

JavaScript
6
star
67

vue-composition-api-example

Vue
6
star
68

laravel-vue-react-example

PHP
5
star
69

vue-mirage-example

Vue
5
star
70

lc-laravel-graphql

PHP
5
star
71

vue-sanctum-example

Vue
5
star
72

lc-cookbook-examples

PHP
5
star
73

lc-nuxt-3-blog

Vue
5
star
74

lc-cashier-stripe-example

PHP
5
star
75

ulp-laravel-socialite

PHP
5
star
76

vue-scoped-slots-example

JavaScript
4
star
77

laravel-graphqlclient-example

PHP
4
star
78

sanctum-example

PHP
4
star
79

vuepress-example

Vue
4
star
80

laravel-spaces-example

Code for YouTube video on using DigitalOcean Spaces with Laravel
PHP
3
star
81

ulp-laravel-enum

PHP
3
star
82

playground-inertia-react

PHP
3
star
83

lc-react

JavaScript
3
star
84

lc-nuxt-3-example

Vue
3
star
85

ulp-laravel-cashier

PHP
3
star
86

masonry-example

PHP
3
star
87

ulp-laravel-breadcrumbs

PHP
3
star
88

laravel-vite-vue-spa

PHP
3
star
89

ionic-angular-example

TypeScript
3
star
90

app-store-laravel

PHP
3
star
91

lc-weather-app

PHP
3
star
92

vue-showerthoughts

Vue
3
star
93

lc-laravel-vue3-example

PHP
3
star
94

nativephp-example

PHP
3
star
95

react-render-props-example

CSS
2
star
96

graphql-laravel-example

PHP
2
star
97

ulp-laravel-datatables

PHP
2
star
98

vue3-change-detection

Vue
2
star
99

ulp-guzzle

PHP
2
star
100

ulp-wink

PHP
2
star