Blog Detail

18

Jan
Create Laravel E-commerce StoreFront with GetCandy Package cover image

arrow_back Create Laravel E-commerce StoreFront with GetCandy Package

GetCandy is a package that brings functionality related to Shopify and other e-commerce platforms to Laravel. You have complete freedom to create your own storefront(s), but this package has already done the hard work for you in the backend.

Key Features

  • Open Source:
    It offers robust e-commerce functionality right inside Laravel. It is free to use and constantly improving.

  • A True Laravel Package:
    You can add GetCandy to any Laravel application and have the functionality to rival Shopify, Big Commerce, etc.

  • Admin Hub:
    Not only do you benefit from the core e-commerce functionality, but it also has a modern admin system that you can extend with your own custom add-ons.

Requirements

  • PHP ^8.0
  • Laravel 8+
  • MySQL 5.7+ / PostgreSQL 9.2+

Installation

For the installation purpose via composer, You’ve to run this command:

composer require getcandy/admin

Next, you need to publish the config files.

php artisan vendor:publish --tag=getcandy

Search Configuration

GetCandy uses Laravel Scout for search. We have had success utilizing Meilisearch, although it’s totally up to you which driver you use, as long as it’s consistent.

Next, Publish the Scout config.

php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"

By default, the scout has the setting soft_delete set to false. You’ve to make sure this is set to true otherwise you will see soft deleted models appear in your search results.

Admin Hub Setup

The admin hub is provided to enable you to manage your store via a modern interface. You can manage all aspects of your store including products, orders, staff members, etc. It’s built on using Laravel livewire and can be extended to meet each of your store’s requirements.

Publish Assets

The admin hub needs some assets to work. You’ve to run the following command to publish them to your public directory.

php artisan getcandy:hub:install

Run Migrations

GetCandy employs table prefixes to avoid conflicts with your app’s tables. So you can change this in the configuration.

As you’d expect, there are quite a few tables GetCandy needs to function, so run the migrations now.

php artisan migrate

Run the Artisan Installer

php artisan getcandy:install

This will take you through a set of questions to configure your GetCandy install. The process includes:

  • Creating a default admin user (if required)
  • Seeding initial data
  • Inviting you to star our repo on GitHub

Final Meilisearch Set-up

If you are using Meilisearch, you just need to do some final configuration. Simply run this command.

php artisan getcandy:meilisearch:setup

Success: You are now installed! You can access the admin hub at

http://<yoursite>/hub

Core

The core GetCandy package provides all the things needed for your store to function. This is where all the models, actions, and utilities live and are required by the admin hub.

For more detailed documentation and source code, you can visit Github.

Published at : 18-01-2022

Author : Rizwan Aslam
AUTHOR
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

Launch your project

Launch project