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 ?.

View Comments

Recent Posts

Generating Thumbnails with Spatie Media Library in Laravel 11: A Step-by-Step Guide

Generating image thumbnails is a common requirement in web applications, especially when handling media-heavy content.…

5 hours ago

Enhancing Web Application Security with Laravel’s Built-In Features

In today’s digital landscape, web application security is paramount. As a powerful PHP framework, Laravel…

1 day ago

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

October was an exciting month for MageComp! From significant updates across our Magento 2 extension…

1 day ago

Improving Error Handling and Transition Management in Remix with useRouteError and useViewTransitionState

In modern web development, seamless navigation and state management are crucial for delivering a smooth…

1 week ago

Magento Open Source 2.4.8-Beta Release Notes

Magento Open Source 2.4.8 beta version released on October  8, 2024. The latest release of…

1 week ago

How to Create Catalog Price Rule in Magento 2 Programmatically?

Hello Magento Friends, Creating catalog price rules programmatically in Magento 2 can be a valuable…

1 week ago