Easy E-Commerce Using Laravel and Stripe
$29.99
Minimum price
$34.00
Suggested price

Easy E-Commerce Using Laravel and Stripe

Selling Products and Subscriptions

About the Book

August 6, 2015 Update: The book has been updated for Laravel 5.1 and includes a new chapter titled "Integrating a Shopping Cart"!

The local lawn care and landscaping company We Dew Lawns, Inc. has contacted you about building and launching an ambitious corporate website. The surly company owner Todd McDew isn't exactly a technophile, but he's well aware of the potential new revenue streams a well-designed website can introduce to the company. Among other features he would like you to create an online store capable of selling both electronic and physical products, as well as lawn care service subscriptions.

Easy E-Commerce Using Laravel and Stripe guides you through the creation of the WeDewLawns.com. Each project phase introduces new features to the website which are typical of a small but capable online store, including a robust contact form, user accounts, and a restricted area where registered users can download coupons and receive other exclusive offers. You'll also learn how to create a product catalog which can be managed using a restricted administration console.

From there you'll learn how to integrate the popular Stripe payment processing service using Laravel Cashier. You'll learn how to customize many aspects of a Stripe account, customize the Stripe checkout modal, and create a solution which customers can use to download electronic products such as lawn care guides. The final project phase guides you through the integration of Stripe's recurring payments (subscriptions) feature. You'll learn how to create multiple subscription tiers, and build a robust interface allowing customers to select a desired tier and input their payment information for subsequent recurring billing purposes.

Book Highlights

  • Includes all of the source code to a real-world online store.
  • You will receive free updates as we continue to improve and expand the book and companion project.
  • Learn how to integrate Stripe payment processing capabilities into a Laravel-powered website in a fun, entertaining, and unintimidating fashion by following along with the creation of a real-world project for a fictional company. Just don't get on company owner Mr. McDew's bad side!

  • Includes coverage of many concepts central to building an online store, such as how to build a product management interface and a one-time URL generator for downloading electronic products.
  • Written by bestselling author W. Jason Gilmore and Laravel News founder Eric L. Barnes, two industry veterans with more than 30 years of combined experience using the PHP language.

Table of Contents

Easy E-Commerce Using Laravel and Stripe is divided into five chapters. Each chapter introduces a fundamental concept associated with building a practical online store for a small business interested in building its customer base, selling products, and selling online subscriptions.

Chapter 1. Creating the We Dew Lawns Website

In this opening phase you'll be tasked with the creation of a fairly simple Laravel-driven website that tells prospective customers more about the business, and offers a user-friendly contact form which sends inquiries to the company assistant, Patty Organo.

To suit this requirement, you'll work through the creation of a new Laravel 5 website complete with Less, Elixir, and Bootstrap integration. You'll also create a home and company bio pages, a site-wide layout, and a contact form.

Chapter 2. Integrating User Accounts

Following a successful launch of the first phase, Mr. McDew would like to begin building a customer mailing list. To entice individuals into handing over their valuable e-mail addresses he would like to offer registered users access to downloadable coupons which they can then apply to lawn care services. In this chapter you'll integrate and customize user registration and authentication features into the site, and create a restricted area of the site accessible only to authenticated users.

Chapter 3. Integrating Stripe and Creating a Product Catalog

With the site launched and the mailing list continuing to grow, Mr. McDew's ambitions have now turned to online sales. He would like to create a simple online store for selling products such as lawn mowers and gardening tools. In this chapter you'll integrate Laravel Cashier to easily and securely accept credit card payments. You'll also learn how to create a restricted administration console complete with a product catalog manager so Mr. McDew and his team can easily add and update products.

Chapter 4. Selling Electronic and Physical Products

With Stripe and Laravel Cashier integrated, and your product catalog created, it's time to begin selling products! In this chapter you'll learn how to sell electronic (downloadable) and physical products through your website. We'll show you how to integrate the secure Stripe "Buy" button and modal, complete transactions using Cashier, and generate one-time URLs for automated product downloads. We'll also talk a bit about shipping and sales tax complexities, and identify a few popular associated resources.

Chapter 5. Selling Subscriptions

In this final project phase, Mr. McDew sets his sights on selling lawn care subscriptions. In this chapter you'll learn how to integrate Stripe's recurring billing service into the We Dew Lawns website, and sell a number of lawn care service tiers to area customers. You'll also learn how to configure webhooks to autonomously receive and respond to various subscription-related events.

Chapter 6. Integrating a Shopping Cart

Thus far we've preferred to focus on Laravel- and Stripe-related fundamentals so as to ensure everything is working flawlessly before introducing more complicated features. In this chapter we'll change that by adding shopping cart capabilities to the site. By the conclusion of this chapter you'll have successfully integrated a shopping cart into the site, allowing customers to truly shop the site, and conveniently purchase more than one product during a single session.

  • Share this book

  • Categories

    • Software
    • Laravel

About the Authors

W. Jason Gilmore
W. Jason Gilmore

W. Jason Gilmore (http://www.wjgilmore.com) is author of several bestselling books, including Easy Laravel 5 (http://easylaravelbook.com) and Beginning PHP and MySQL, Fourth Edition (Apress). He's a software developer and consultant who has spent much of the past 17 years helping companies of all sizes build amazing solutions. Recent projects include a Stripe-powered SaaS for the interior design industry, an e-commerce analytics application for a globally recognized publisher, a Linux-powered autonomous environmental monitoring buoy, and a 10,000+ product online store.Over the years Jason has authored nine books on web development, published more than 300 articles within popular publications such as Developer.com, JSMag, and Linux Magazine, and instructed hundreds of students in the United States and Europe. Jason is co-founder of the wildly popular [CodeMash Conference](http://www.codemash.org), the largest multi-day developer event in the Midwest.Away from the keyboard, you'll often find Jason hanging out with his family, hunched over a chess board, and having fun with DIY electronics.

Eric L. Barnes
Eric L. Barnes

Eric L. Barnes runs and operates Laravel News, a site bringing the Laravel community all the latest news and information about the framework, and is a full-time product engineer. He has worked with PHP and various web technologies for the past 14 years.

Table of Contents

  • Introduction
    • About the Book Project
    • Downloading the We Dew Lawns Project
    • About the Authors
    • Contact the Authors
  • Chapter 1. Creating the We Dew Lawns Website
    • Creating the We Dew Lawns Project
    • Creating the Project Layout
    • Introducing Elixir
    • Creating the Home Page
    • Creating the About Us Page
    • Adding a Contact Form
    • Deploying the Website
    • The Project Presentation
    • Summary
  • Chapter 2. Integrating User Accounts
    • Integrating User Account Registration
    • Integrating User Authentication
    • Display a Greeting in the Layout Header
    • Creating and Restricting the Discount Controller
    • Signing Users Out of the Website
    • Recovering User Passwords
    • The Project Presentation
    • Summary
  • Chapter 3. Integrating Stripe and Creating a Product Catalog
    • Introducing Stripe
    • Introducing Cashier
    • Creating the Product Catalog
    • Creating an Administration Console
    • Summary
  • Chapter 4. Selling Electronic and Physical Products
    • Purchasing Products Using Stripe
    • The Project Presentation
    • Summary
  • Chapter 5. Selling Subscriptions
    • Defining the Subscription Plans
    • Integrating Plans into the Website
    • Integrating Stripe Into the Subscription Flow
    • Integrating Subscription Management Features
    • Listening to Events with Webhooks
    • Processing a Webhook Event
    • Creating Coupons
    • The Project Presentation
    • Summary
  • Chapter 6. Integrating a Shopping Cart
    • Creating the Cart Model
    • Creating the Carts Controller
    • Where to From Here?
    • The Project Presentation
    • Summary

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub