Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NotificationsYou must be signed in to change notification settings

drehimself/laravel-ecommerce-example

Repository files navigation

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 andcd 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. SpecificallySTRIPE_KEY andSTRIPE_SECRET
  7. Set your Algolia credentials in your.env file. SpecificallyALGOLIA_APP_ID andALGOLIA_SECRET. Seethis episode.
  8. Set your Braintree credentials in your.env file if you want to use PayPal. SpecificallyBT_MERCHANT_ID,BT_PUBLIC_KEY,BT_PRIVATE_KEY. Seethis episode. If you don't, it should still work but won't show the paypal payment at checkout.
  9. Set yourAPP_URL in your.env file. This is needed for Voyager to correctly resolve asset URLs.
  10. SetADMIN_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. Seethis episode.
  12. npm install
  13. npm run dev
  14. php artisan serve or use Laravel Valet or Laravel Homestead
  15. Visitlocalhost:8000 in your browser
  16. Visit/admin if you want to access the Voyager admin backend. Admin User/Password:admin@admin.com/password. Admin Web User/Password:adminweb@adminweb.com/password

Shopping Cart Package

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

Windows Users - money_format() issue

Themoney_format function does not work in Windows. Take a look atthis thread. As an alternative, just use thenumber_format function instead.

  1. Inapp/helpers.php replacemoney_format line withreturn '$'.number_format($price / 100, 2);
  2. Inapp/Product.php replacemoney_format line withreturn '$'.number_format($this->price / 100, 2);
  3. Inconfig/cart.php set thethousand_seperator to an empty string or you might get a 'non well formed numeric value encountered' error. It conflicts withnumber_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 withany particular commit.

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

Releases

No releases published

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp