How To

How to Build Shopify PHP App with the help of Shopify CLI?

In this blog, we will learn How to Create a Laravel Shopify App using Shopify Command-Line Interface (CLI).

Shopify CLI (Command Line Interface) helps to create Shopify Apps. Using CLI, you can quickly generate Shopify apps and app extensions.Ā 

Requirements for Creating Shopify PHP App using Shopify CLI:

  • Create a Partner account and a development store
  • Install Node.js 14.17.0 or higher
  • Install a Node.js package manager: either npm, Yarn 1.x, or pnpm
  • Install Git 2.28.0 or higher
  • Use the latest version of Chrome or Firefox

Steps to Create Shopify PHP App using Shopify CLI:

Step 1: Enter the below command in your directory

npm init @shopify/app@latest

You will be asked to enter the app name

Then select the php templateĀ 

Step 2: Go to your newly created app directory using the following command

cd blog-test

Step 3: Go to the web folder using the below commandĀ 

cd web

Step 4: Install your composer dependenciesĀ 

composer install

Step 5: Next, create a .env file using the below commandĀ 

cp .env.example .env

After that, create the database you want and add details of the database in the .env fileĀ 

Step 6: Now, generate APP_KEY for the app

php artisan key:generate

Step 7:Ā  Then, create tables for the database using the below command

php artisan migrate

Tadaa! Your Laravel app is ready.

Step 8: Now you need to switch back to your appā€™s root folder using the below command

cd ..

Now run the below command in your terminal to start your appĀ 

npm run dev

Copy the Preview Url and paste it into your browser to install the appĀ 

Step 9: You have to login into your Shopify admin store

Click Install app to install the app in the store

And your app is created successfully

Conclusion:

This way, you can Create Shopify PHP App using Shopify CLI. If you have any doubts, share them with me through the comment section. Share the article with your Shopify or Laravel friends to help them create Shopify Apps using Shopify CLI commands.

Happy Coding!

Click to rate this post!
[Total: 6 Average: 4.3]
Bharat Desai

Bharat Desai is a Co-Founder at MageComp. He is an Adobe Magento Certified Frontend Developer šŸ… with having 8+ Years of experience and has developed 150+ Magento 2 Products with MageComp. He has an unquenchable thirst to learn new things. On off days you can find him playing the game of Chess ā™Ÿļø or Cricket šŸ.

Recent Posts

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

21 hours ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

3 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

3 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

4 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

5 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

1 week ago