junedc / devlob-laravel-app

Laravel app following devlob tutorials

Home Page:https://www.youtube.com/watch?v=mOJO3N5UdP0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StitchLite

StitchLite communicates with Shopify and Vend’s respective APIs to download product information.

Create app

Generate application using this script

Set up Shopify

Sign up for Shopify free trial and create a store.

Initialize store with three new products.

Create three products in Shopify. Make sure to fill in SKU field for every product (such as 1, 2, 3).

products added to shopify

Shopify API docs

Make StitchLite Authentication

$ php artisan make:auth
$ php artisan migrate

Make sure you have updated your .env file with the values to connect to your database. In order to update them make sure to clear the config:

$ php artisan config:clear

This will generate Laravel's default authentication scaffolding with a users table and bootstrap based login and register pages. By default the /home route will be protected so that only authenticated users can view it.

Products table

Make a Products table, model and resource controller:

$ php artisan make:model Product -mcr  

Products need Product Name, SKU, Quantity and Price. Update the Products database migration to create the appropriate columns:

public function up()
{
    Schema::create('products', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name');
        $table->integer('sku')->unique();
        $table->integer('quantity');
        $table->integer('price'); // price in cents
        $table->timestamps();
    });
}

Run the migration with php artisan migrate

Connect to Shopify

Using phpclassic/php-shopify to grab shopify products.

Create custom facade and register in app service provider and register in config/app.php. Call method to grab products in controller and add those products to the products database table.

When the user clicks connect with Connect with Shopify it'll store their products from shopify in the stitchlite database and trigger a hard refresh, displaying them to user on the home page.

Add products to Vend

Add some new products to a Vend account. Some will have the same SKU as the shopify products, others will be uniquely sold on vend.

In this case I am selling hats and stickers on Vend and Shopify platforms. The hats and stickers have the same SKU across platforms (1 for stickers, 3 for hats). I am also selling "Special Vend Product" on Vend with an SKU of specialvendproduct. The "Special Vend Product" is not sold on Shopify.

"Employbl Tshirt" (SKU of 2) is sold on Shopfy but not sold on Vend.

Vend Developer Account

We'll also need to create a Vend Developer Account. This is in addition to and separate from our Vend merchant account.

Vend requires that we use OAuth2 Authorization Code Grant to connect to their API. Create a new application in the developer portal:

Connect Vend products

About

Laravel app following devlob tutorials

https://www.youtube.com/watch?v=mOJO3N5UdP0


Languages

Language:PHP 80.5%Language:HTML 17.5%Language:Vue 1.9%