There is no problem not worth solving, and no technology not worth learning!

Create apps using Shopify CLI (PHP-based application templates) and install them in the store

重新从第 7 步骤开始执行,跳过第 9 步骤。您现在有一个安装了新应用程序的开发商店

1. Navigate to the directory where you want to create the application (e:\wwwroot\shopify-app). Your application will be created in a new subdirectory. as shown in Figure 1

导航到要在其中创建应用程序的目录(E:\wwwroot\shopify-app)。您的应用程序将在一个新的子目录中创建
Figure 1
PS E:\wwwroot\shopify-app> pwd

path
---
E:\wwwroot\shopify-app

2. Run one of the following commands to create a new application, and then select the language of the application template you want to start using: Node, PHP, or Ruby. Choose PHP. The following figure shows the application successfully created in the terminal. as shown in Figure 2

运行以下命令之一以创建新应用,然后选择要开始使用的应用模板的语言:Node、PHP 或 Ruby。选择 PHP。下图显示了在终端中成功创建的应用程序
Figure 2
PS e:\wwwroot\shopify-app> yarn create @shopify/app
YARN CREATE v1.22.15
[1/4]resolving packages...
[2/4]fetching packages...
[3/4]Linking Dependencies...
[4/4]Building fresh packages...
The latest version is "1.22.19", while youRe on "1.22.15".
Success Installed "@shopify/create-app@3.16.3" with binary:
- create-app

Welcome. Let's get started by naming your app. You can change it later.
✔ Your AppS name? Learn-App
✔ Which template would you like to use?
✔ Downloaded template fromhttps://github.com/Shopify/shopify-app-template-php#cli_three
✔ App Initialized
✔ Liquid parsed
✔ updated package.json
✔ Dependencies installed with yarn
✔ Installed Dependencies in /
✔ Installed dependencies in /web/frontend/
✔ Completed clean up
✔ Git Repository Initialized

Learn-App is ready for you to build!
Check the setup instructions in your readme file
To preview your project, run yarn dev
To add extensions, run yarn generate extensions
For more details on all that you can build, see the docs: Shopify.dev (​https://shopify.dev​)✨

For help and a list of commands, enter yarn Shopify app --help

Done in 1828.53s.

3. Start the local development server. Navigate to your newly created application directory: e:\wwwroot\shopify-app\learn-app

4. Set up your Laravel app. Reference:https://github.com/Shopify/shopify-app-template-php/tree/cli_three#setting-up-your-laravel-app. Since the touch command in the Windows terminal is not available, create a new storage/db.sqlite in phpstorm. Create the data source in the new path, and the driver selects sqlite and the name is db. Figure 3, Figure 4

由于 Windows 终端中 touch 命令不可用,在 PhpStorm 中新建 storage/db.sqlite。新建路径中的数据源,驱动程序选择 SQLite,名称为 db
Figure 3

 

由于 Windows 终端中 touch 命令不可用,在 PhpStorm 中新建 storage/db.sqlite。新建路径中的数据源,驱动程序选择 SQLite,名称为 db
Figure 4
PS E:\wwwroot\shopify-app\learn-app> cd web
PS E:\wwwroot\shopify-app\learn-app\web> ls

Directory: E:\wwwroot\shopify-app\learn-app\web

Mode lastwritetime length name
--------------------------------
D----- 2022/10/14 14:54 APP
D---- 2022/10/14 14:54 Bootstrap
D---- 2022/10/14 14:54 config
D----- 2022/10/14 14:54 database
D----- 2022/10/14 14:54 Frontend
D---- 2022/10/14 14:54 Public
D----- 2022/10/14 14:54 Resources
D---- 2022/10/14 14:54 Routes
D---- 2022/10/14 14:54 Storage
-a---- 2022/10/14 14:50 261 .env.example
-a--- 2022/10/14 14:50 370 .env.testing
-A---- 2022/10/14 14:50 1743 Artisan
-a---- 2022/10/14 14:50 2282 composer.json
-A---- 2022/10/14 14:50 469 entrypoint.sh
-A---- 2022/10/14 14:50 898 nginx.conf
-a---- 2022/10/14 14:50 1233 phpunit.xml
-a--- 2022/10/14 14:50 584 server.php
-a---- 2022/10/14 14:50 80 Shopify.Web.toml

PS e:\wwwroot\shopify-app\learn-app\web> composer install
No composer.Lock file present. Updating dependencies to latest instead of installing from lock file. Seehttps://getcomposer.org/installfor more information.
Loading composer repositories with package information
info fromhttps://repo.packagist.org:#standwithukraine
Updating dependencies
lock file operations: 114 installs, 0 updates, 0 removals
- locking brick/math (0.9.3)
- locking dflydev/dot-access-data (v3.0.1)
- Locking doctrine/cache (2.2.0)
- Locking doctrine/dbal (3.4.5)
- locking doctrine/deprecations (v1.0.0)
- Locking Doctrine/Event-Manager (1.2.0)
- Locking Doctrine/Inflector (2.0.5)
- Locking Doctrine/Instantiator (1.4.1)
- Locking doctrine/lexer (1.2.3)
- Locking Dragonmantank/cron-expression (v3.3.2)
- Locking egulias/email-validator (2.1.25)
- locking facade/flare-client-php (1.10.0)
- Locking Facade/Ignition (2.17.6)
- locking facade/ignition-contracts (1.0.2)
- Locking FakerPHP/Faker (v1.20.0)
- Locking Fideloper/Proxy (4.4.2)
- Locking filp/whoops (2.14.5)
- Locking firebase/php-jwt (v5.5.1)
- Locking fruitcake/Laravel-cors (v3.0.0)
- Locking fruitcake/php-cors (v1.2.0)
- Locking Graham-Campbell/Result-Type (v1.1.0)
- Locking guzzlehttp/guzzle (7.5.0)
- Locking guzzlehttp/promises (1.5.2)
- Locking GuzzleHttp/PSR7 (2.4.1)
- Locking Hamcrest/Hamcrest-php (v2.0.1)
- Locking Laravel/Framework (v8.83.25)
- Locking Laravel/Sail (v1.16.2)
- locking laravel/serializable-closure (v1.2.2)
- Locking Laravel/Tinker (v2.7.2)
- Locking League/Commonmark (2.3.5)
- Locking League/Config (v1.1.1)
- Locking League/FlySystem (1.1.10)
- Locking League/MIME-Type-detection (1.11.0)
- Locking Mockery/Mockery (1.5.1)
- locking monolog/monolog (2.8.0)
- locking mylabs/deep-copy (1.11.0)
- Locking Nesbot/Carbon (2.62.1)
- Locking nette/schema (v1.2.2)
- Locking nette/utils (v3.2.8)
- Locking Nikic/PHP-Parser (v4.15.1)
- Locking Nunomaduro/Collision (v5.11.0)
- Locking OPIS/Closure (3.6.3)
- Locking Phar-io/Manifest (2.0.3)
- Locking Phar-io/Version (3.2.1)
- Locking phpooption/phpooption (1.9.0)
- locking phpunit/php-code-coverage (9.2.17)
- locking phpunit/php-file-iterator (3.0.6)
- locking phpunit/php-invoker (3.1.1)
- locking phpunit/php-text-template (2.0.4)
- locking phpunit/php-timer (5.0.3)
- locking phpunit/phpunit (9.5.25)
- Locking PSR/Cache (1.0.1)
- Locking PSR/Container (1.1.2)
- Locking PSR/Event-Dispatcher (1.0.0)
- Locking PSR/HTTP-Client (1.0.1)
- Locking PSR/HTTP-Factory (1.0.1)
- Locking PSR/HTTP-Message (1.0.1)
- locking PSR/log (1.1.4)
- Locking PSR/Simple-Cache (1.0.1)
- Locking PSY/PSYSH (v0.11.8)
- Locking Ralouchie/GetAllHeaders (3.0.3)
- Locking Ramsey/Collection (1.2.2)
- Locking Ramsey/UUID (4.2.3)
- locking sebastian/cli-parser (1.0.1)
- locking sebastian/code-unit (1.0.8)
- locking sebastian/code-unit-reverse-lookup (2.0.3)
- Locking Sebastian/Comparator (4.0.8)
- Locking Sebastian/Complexity (2.0.2)
- Locking Sebastian/Diff (4.0.4)
- Locking Sebastian/Environment (5.1.4)
- Locking Sebastian/Exporter (4.0.5)
- Locking Sebastian/Global-State (5.0.5)
- locking sebastian/lines-of-code (1.0.3)
- locking sebastian/object-enumerator (4.0.4)
- locking sebastian/object-reflector (2.0.4)
- locking sebastian/recursion-context (4.0.4)
- locking sebastian/resource-operations (3.0.3)
- Locking Sebastian/Type (3.2.0)
- Locking Sebastian/Version (3.0.2)
- Locking Shopify/Shopify-API (v4.1.0)
- locking squizlabs/php_codesniffer (3.7.1)
- Locking Swiftmailer/SwiftMailer (v6.3.0)
- locking symfony/console (v5.4.14)
- Locking symfony/CSS-selector (v5.4.11)
- locking symfony/deprecation-contracts (v2.5.2)
- locking symfony/error-handler (v5.4.14)
- locking symfony/event-dispatcher (v5.4.9)
- locking symfony/event-dispatcher-contracts (v2.5.2)
- locking symfony/finder (v5.4.11)
- locking symfony/http-foundation (v5.4.14)
- locking symfony/http-kernel (v5.4.14)
- Locking symfony/mime (v5.4.14)
- locking symfony/polyfill-ctype (v1.26.0)
- locking symfony/polyfill-iconv (v1.26.0)
- locking symfony/polyfill-intl-graphe (v1.26.0)
- locking symfony/polyfill-intl-idn (v1.26.0)
- locking symfony/polyfill-intl-normalizer (v1.26.0)
- locking symfony/polyfill-mbstring (v1.26.0)
- Locking symfony/polyfill-php72 (v1.26.0)
- locking symfony/polyfill-php73 (v1.26.0)
- Locking symfony/polyfill-php80 (v1.26.0)
- locking symfony/polyfill-php81 (v1.26.0)
- locking symfony/process (v5.4.11)
- locking symfony/routing (v5.4.11)
- locking symfony/service-contracts (v2.5.2)
- locking symfony/string (v5.4.14)
- Locking symfony/translation (v5.4.14)
- locking symfony/translation-contracts (v2.5.2)
- locking symfony/var-dumper (v5.4.14)
- Locking theseer/tokenizer (1.2.1)
- locking tijsverkoyen/css-to-inline-styles (2.2.5)
- Locking vlucas/phpdotenv (v5.4.1)
- Locking Voku/Portable-ASCII (1.6.1)
- Locking Webmozart/Assert (1.11.0)
Writing lock file
Installing dependencies from lock file (inclusion require-dev)
Package operations: 114 installs, 0 updates, 0 removals
- downloading brick/math (0.9.3)
- downloading PSR/log (1.1.4)
- Download PSR/Cache (1.0.1)
- downloading doctrine/event-manager (1.2.0)
- downloading doctrine/dbal (3.4.5)
- downloading symfony/polyfill-ctype (v1.26.0)
- downloading webmozart/assert (1.11.0)
- downloading dragonmantank/cron-expression (v3.3.2)
- downloading symfony/polyfill-php80 (v1.26.0)
- downloading symfony/polyfill-mbstring (v1.26.0)
- downloading symfony/var-dumper (v5.4.14)
- downloading symfony/polyfill-intl-normalizer (v1.26.0)
- downloading symfony/polyfill-intl-graphe (v1.26.0)
- downloading symfony/string (v5.4.14)
- downloading PSR/Container (1.1.2)
- downloading symfony/service-contracts (v2.5.2)
- downloading symfony/polyfill-php73 (v1.26.0)
- downloading symfony/console (v5.4.14)
- downloading monolog/monolog (2.8.0)
- downloading voku/portable-ascii (1.6.1)
- downloading vlucas/phpdotenv (v5.4.1)
- downloading symfony/CSS-selector (v5.4.11)
- downloading symfony/routing (v5.4.11)
- downloading symfony/process (v5.4.11)
- downloading symfony/polyfill-php72 (v1.26.0)
- downloading symfony/polyfill-intl-idn (v1.26.0)
- downloading symfony/mime (v5.4.14)
- downloading symfony/http-foundation (v5.4.14)
- Download PSR/Event-Dispatcher (1.0.0)
- downloading symfony/event-dispatcher-contracts (v2.5.2)
- downloading symfony/event-dispatcher (v5.4.9)
- downloading symfony/error-handler (v5.4.14)
- downloading symfony/http-kernel (v5.4.14)
- downloading symfony/finder (v5.4.11)
- downloading symfony/polyfill-iconv (v1.26.0)
- downloading egulias/email-validator (2.1.25)
- Downloading SwiftMailer/SwiftMailer (v6.3.0)
- downloading symfony/polyfill-php81 (v1.26.0)
- Downloading Ramsey/Collection (1.2.2)
- downloading ramsey/uuid (4.2.3)
- downloading PSR/simple-cache (1.0.1)
- downloading symfony/translation-contracts (v2.5.2)
- downloading symfony/translation (v5.4.14)
- Downloading League/FlySystem (1.1.10)
- downloading nette/utils (v3.2.8)
- Downloading nette/schema (v1.2.2)
- downloading dflydev/dot-access-data (v3.0.1)
- Downloading League/Config (v1.1.1)
- Download Laravel/Serializable-Closure (v1.2.2)
- Downloading Laravel/Framework (v8.83.25)
- Download Facade/Ignition-Contracts (1.0.2)
- downloading facade/flare-client-php (1.10.0)
- Download Facade/Ignition (2.17.6)
- downloading fideloper/proxy (4.4.2)
- downloading fruitcake/php-cors (v1.2.0)
- Downloading fruitcake/Laravel-cors (v3.0.0)
- Download raluphie/GetAllHeaders (3.0.3)
- downloading PSR/Http-message (1.0.1)
- downloading PSR/HTTP-factory (1.0.1)
- downloading guzzlehttp/psr7 (2.4.1)
- Download Laravel/Sail (v1.16.2)
- Downloading PSY/PSYSH (v0.11.8)
- Downloading Laravel/Tinker (v2.7.2)
- downloading mockery/mockery (1.5.1)
- downloading nunomaduro/collision (v5.11.0)
- downloading sebastian/version (3.0.2)
- downloading sebastian/type (3.2.0)
- downloading sebastian/resource-operations (3.0.3)
- downloading sebastian/recursion-context (4.0.4)
- downloading sebastian/object-reflector (2.0.4)
- downloading sebastian/object-enumerator (4.0.4)
- downloading sebastian/global-state (5.0.5)
- downloading sebastian/exporter (4.0.5)
- Download Sebastian/Environment (5.1.4)
- downloading sebastian/diff (4.0.4)
- Downloading Sebastian/Comparator (4.0.8)
- downloading sebastian/code-unit (1.0.8)
- downloading sebastian/cli-parser (1.0.1)
- downloading phpunit/php-timer (5.0.3)
- downloading phpunit/php-text-template (2.0.4)
- downloading phpunit/php-invoker (3.1.1)
- downloading phpunit/php-file-iterator (3.0.6)
- downloading sebastian/lines-of-code (1.0.3)
- Downloading Sebastian/Complexity (2.0.2)
- downloading sebastian/code-unit-reverse-lookup (2.0.3)
- downloading phpunit/php-code-coverage (9.2.17)
- downloading phar-io/version (3.2.1)
- Downloading Phar-IO/Manifest (2.0.3)
- downloading phpunit/phpunit (9.5.25)
- Download PSR/HTTP-Client (1.0.1)
- downloading guzzlehttp/guzzle (7.5.0)
- downloading firebase/php-jwt (v5.5.1)
- Download Shopify/Shopify-API (v4.1.0)
- Installing Brick/Math (0.9.3): Extracting Archive
- Installing PSR/Log (1.1.4): Extracting Archive
- Installing PSR/Cache (1.0.1): Extracting Archive
- Installing Doctrine/Deprecations (v1.0.0): Extracting Archive
- Installing Doctrine/Event-Manager (1.2.0): Extracting Archive
- Installing Doctrine/Cache (2.2.0): Extracting Archive
- Installing Doctrine/DBAL (3.4.5): Extracting Archive
- Installing Doctrine/Lexer (1.2.3): Extracting Archive
- Installing symfony/polyfill-ctype (v1.26.0): extracting archive
- Installing WebMozart/Assert (1.11.0): Extracting Archive
- Installing DragonMantank/cron-expression (v3.3.2): Extracting Archive
- Installing symfony/polyfill-php80 (v1.26.0): extracting archive
- Installing symfony/polyfill-mbstring (v1.26.0): Extracting Archive
- Installing symfony/var-dumper (v5.4.14): Extracting Archive
- Installing symfony/polyfill-intl-normalizer (v1.26.0): Extracting Archive
- Installing symfony/polyfill-intl-graphe (v1.26.0): Extracting Archive
- Installing symfony/string (v5.4.14): Extracting Archive
- Installing symfony/deprecation-contracts (v2.5.2): extracting archives
- Installing PSR/Container (1.1.2): Extracting Archive
- Installing symfony/service-contracts (v2.5.2): extracting archive
- Installing symfony/polyfill-php73 (v1.26.0): Extracting Archive
- Installing symfony/console (v5.4.14): Extracting Archive
- Installing monolog/monolog (2.8.0): Extracting Archive
- Installing voku/portable-ascii (1.6.1): Extracting Archive
-Installing phpooption/phpooption (1.9.0): Extracting Archive
- Installing grad-campbell/result-type (v1.1.0): Extracting Archive
- Installing vlucas/phpdotenv (v5.4.1): Extracting Archive
- Installing symfony/CSS-selector (v5.4.11): extracting archive
-Installing tijsverkoyen/css-to-inline-styles (2.2.5): Extracting Archive
- Installing symfony/routing (v5.4.11): Extracting Archive
- Installing Symfony/Process (v5.4.11): Extracting Archive
- Installing symfony/polyfill-php72 (v1.26.0): Extracting Archive
- Installing symfony/polyfill-intl-idn (v1.26.0): Extracting Archive
- Installing symfony/MIME (v5.4.14): Extracting Archive
- Installing symfony/http-foundation (v5.4.14): Extracting Archive
- Installing PSR/Event-Dispatcher (1.0.0): Extracting Archive
- Installing Symfony/Event-Dispatcher-Contracts (v2.5.2): Extracting Archive
- Installing Symfony/Event-Dispatcher (v5.4.9): Extracting Archive
- Installing symfony/error-handler (v5.4.14): Extracting Archive
- Installing symfony/http-kernel (v5.4.14): Extracting Archive
- Installing symfony/finder (v5.4.11): Extracting Archive
- Installing symfony/polyfill-iconv (v1.26.0): Extracting Archive
- Installing egulias/email-validator (2.1.25): Extracting Archive
- Installing SwiftMailer/SwiftMailer (v6.3.0): Extracting Archive
- Installing symfony/polyfill-php81 (v1.26.0): Extracting Archive
- Installing Ramsey/Collection (1.2.2): Extracting Archive
- Installing Ramsey/UUID (4.2.3): Extracting Archive
- Installing PSR/simple-cache (1.0.1): Extracting Archive
- Installing OPIS/Closure (3.6.3): Extracting Archive
-Installing symfony/translation-contracts (v2.5.2): Extracting Archive
- Installing symfony/translation (v5.4.14): Extracting Archive
- Installing Nesbot/Carbon (2.62.1): Extracting Archive
- Installing League/MIME-Type-detection (1.11.0): Extracting Archive
- Installing League/FlySystem (1.1.10): Extracting Archive
- Installing nette/utils (v3.2.8): Extracting Archive
- Installing nette/schema (v1.2.2): Extracting Archive
- Installing dflydev/dot-access-data (v3.0.1): extracting archive
- Installing League/Config (v1.1.1): Extracting Archive
- Installing League/CommonMark (2.3.5): Extracting Archive
- Installing Laravel/Serializable-Closure (v1.2.2): Extracting Archive
- Installing Doctrine/Inflector (2.0.5): Extracting Archive
- Installing Laravel/Framework (v8.83.25): Extracting Archive
- Installing Facade/Ignition-Contracts (1.0.2): Extracting Archive
- Installing facade/flare-client-php (1.10.0): Extracting Archive
- Installing Facade/Ignition (2.17.6): Extracting Archive
- Installing FakerPHP/Faker (v1.20.0): Extracting Archive
- Installing Fideloper/Proxy (4.4.2): Extracting Archive
- Installing fruitcake/php-cors (v1.2.0): Extracting Archive
- Installing fruitcake/Laravel-cors (v3.0.0): Extracting Archive
- Installing GuzzleHttp/Promises (1.5.2): Extracting Archive
- Installing Ralouchie/GetAllHeaders (3.0.3): Extracting Archive
- Installing PSR/Http-Message (1.0.1): Extracting Archive
- Installing PSR/Http-factory (1.0.1): Extracting Archive
- Installing guzzlehttp/psr7 (2.4.1): Extracting Archive
- Installing Laravel/Sail (v1.16.2): Extracting Archive
- Installing Nikic/PHP-Parser (v4.15.1): Extracting Archive
- Installing PSY/PSYSH (v0.11.8): Extracting Archive
- Installing Laravel/Tinker (v2.7.2): Extracting Archive
- Installing Hamcrest/Hamcrest-php (v2.0.1): Extracting Archive
- Installing mockery/mockery (1.5.1): Extracting Archive
- Installing filp/whoops (2.14.5): Extracting Archive
- Installing NUNOMADURO/COLLISION (v5.11.0): Extracting Archive
- Installing Sebastian/Version (3.0.2): Extracting Archive
- Installing Sebastian/Type (3.2.0): Extracting Archive
- Installing Sebastian/Resource-Operations (3.0.3): Extracting Archive
- Installing Sebastian/Recursion-Context (4.0.4): Extracting Archive
- Installing Sebastian/Object-Reflector (2.0.4): Extracting Archive
- Installing Sebastian/Object-Enumerator (4.0.4): Extracting Archive
- Installing Sebastian/Global-State (5.0.5): Extracting Archive
- Installing Sebastian/Exporter (4.0.5): Extracting Archive
- Installing Sebastian/Environment (5.1.4): Extracting Archive
- Installing Sebastian/Diff (4.0.4): Extracting Archive
- Installing Sebastian/Comparator (4.0.8): Extracting Archive
- Installing Sebastian/Code-Unit (1.0.8): Extracting Archive
- Installing sebastian/cli-parser (1.0.1): Extracting Archive
- Installing phpunit/php-timer (5.0.3): Extracting Archive
-Installing phpunit/php-text-template (2.0.4): extracting archive
- Installing theseer/Tokenizer (1.2.1): Extracting Archive
- Installing Sebastian/Lines-of-Code (1.0.3): Extracting Archive
- Installing Sebastian/Complexity (2.0.2): Extracting Archive
- Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting Archive
- Installing phpunit/php-code-coverage (9.2.17): Extracting Archive
- Installing Phar-IO/Version (3.2.1): Extracting Archive
- Installing Phar-io/Manifest (2.0.3): Extracting Archive
- Installing mylabs/deep-copy (1.11.0): extracting archive
- Installing Doctrine/Instantiator (1.4.1): Extracting Archive
- Installing phpunit/phpunit (9.5.25): Extracting Archive
- Installing PSR/Http-Client (1.0.1): Extracting Archive
- Installing GuzzleHttp/Guzzle (7.5.0): Extracting Archive
- Installing firebase/php-jwt (v5.5.1): Extracting Archive
- Installing Shopify/Shopify-API (v4.1.0): Extracting Archive
- Installing squizlabs/php_codesniffer (3.7.1): extracting archive
68 Package suggests were added by new dependencies, use `Composer suggest` to see details.
Package SwiftMailer/SwiftMailer is bandoned, you should avoid using it. Use symfony/mailer instead.
GENERATING OPTIMIZED AUTOLOAD FILES
> Illuminate\Foundation\ComposerScripts::PostAutoLoadDump
> @php artisan package:discover --ansi
Discovered Package: Facade/Ignition
Discovered Package: FideLoper/Proxy
Discovered Package: Fruitcake/Laravel-Cors
Discovered Package: Laravel/Sail
Discovered Package: Laravel/Tinker
Discovered Package: Nesbot/Carbon
Discovered Package: NUNOMADURO/COLLISION
Package manifested successfully.
81 packages you are using are looking for funding.
Use the `Composer Fund` command to find out more!
PS E:\wwwroot\shopify-app\learn-app\web> ls

Directory: E:\wwwroot\shopify-app\learn-app\web

Mode lastwritetime length name
--------------------------------
D---- 2022/10/14 14:54 Bootstrap
D----- 2022/10/14 14:54 database
D----- 2022/10/14 14:54 Frontend
D---- 2022/10/14 14:54 Public
D----- 2022/10/14 14:54 Resources
D---- 2022/10/14 14:54 Routes
D---- 2022/10/14 14:54 Storage
D----- 2022/10/14 15:26 Vendor
-A--- 2022/10/14 14:50 261 .env
-a---- 2022/10/14 14:50 261 .env.example
-a--- 2022/10/14 14:50 370 .env.testing
-A---- 2022/10/14 14:50 1743 Artisan
-a---- 2022/10/14 14:50 2282 composer.json
-a--- 2022/10/14 15:26 303790 composer.lock
-A---- 2022/10/14 14:50 469 entrypoint.sh
-A---- 2022/10/14 14:50 898 nginx.conf
-a---- 2022/10/14 14:50 1233 phpunit.xml
-a--- 2022/10/14 14:50 584 server.php
-a---- 2022/10/14 14:50 80 Shopify.Web.toml

PS E:\wwwroot\shopify-app\learn-app\web> touch storage/db.sqlite
Touch : Failed to recognize the "touch" item as the name of cmdlet, function, script file, or runner. Please check the spelling of the name, if the path is included, make sure the path is correct
Yes, then try again.
Location Line: 1 Characters: 1
+ touch storage/db.sqlite
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (touch:string)[], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS E:\wwwroot\shopify-app\learn-app\web> php artisan key:generate
PS E:\wwwroot\shopify-app\learn-app\web> ls

Directory: E:\wwwroot\shopify-app\learn-app\web

Mode lastwritetime length name
--------------------------------
D----- 2022/10/14 14:54 APP
D---- 2022/10/14 14:54 Bootstrap
D---- 2022/10/14 14:54 config
D----- 2022/10/14 14:54 database
D----- 2022/10/14 14:54 Frontend
D---- 2022/10/14 14:54 Public
D----- 2022/10/14 14:54 Resources
D---- 2022/10/14 14:54 Routes
D---- 2022/10/14 15:42 Storage
D----- 2022/10/14 15:26 Vendor
-a--- 2022/10/14 15:44 337 .env
-a---- 2022/10/14 14:50 261 .env.example
-a--- 2022/10/14 14:50 370 .env.testing
-A---- 2022/10/14 14:50 1743 Artisan
-a---- 2022/10/14 14:50 2282 composer.json
-a--- 2022/10/14 15:26 303790 composer.lock
-A---- 2022/10/14 14:50 469 entrypoint.sh
-A---- 2022/10/14 14:50 898 nginx.conf
-a---- 2022/10/14 14:50 1233 phpunit.xml
-a--- 2022/10/14 14:50 584 server.php
-a---- 2022/10/14 14:50 80 Shopify.Web.toml

5. Create the necessary Shopify table in your database, and report an error: illuminate\Database\QueryException could not find driver (sql: pragma foreign_keys = on;). as shown in Figure 5

在您的数据库中创建必要的 Shopify 表,报错:Illuminate\Database\QueryException  could not find driver (SQL: PRAGMA foreign_keys = ON;)
Figure 5
PS E:\wwwroot\shopify-app\learn-app\web> php artisan migrate

ILUMINATE\Database\QueryException

Could not find driver (SQL: pragma foreign_keys = on;)

at e:\wwwroot\shopify-app\learn-app\web\vendor\laravel\framework\src\illuminate\database\connection.php:712
708▕ // If an exception occurred when attempting to run a query, weLL format the error
709▕ // Message to include the bindings with SQL, which will make this exception A
710▕ // Lot more helpful to the developer instead of just the databases errors.
711▕ catch (exception $e) {
➜ 712▕ Throw New QueryException(
713▕ $Query, $this->preparebindings($bindings), $E
714▕ );
715▕ }
716▕ }

1 E:\wwwroot\shopify-app\learn-app\web\vendor\laravel\fram eWork\src\illuminate\database\connectors\connector.php:70
PDOException::("Could not find driver")

2 E:\wwwroot\shopify-app\learn-app\web\vendor\laravel\fram eWork\src\illuminate\database\connectors\connector.php:70
pdo::__construct("sqlite:e:\wwwroot\shopify-app\learn-app\web\storage\db.sqlite",[])
PS e:\wwwroot\shopify-app\learn-app\web>

6. Edit php.ini, extension=PDO_SQLite. Restart php . Check the database, the table is newly created successfully. as shown in Figure 6

编辑 php.ini,extension=pdo_sqlite。重启 PHP 。查看数据库,表新建成功
Figure 6
PS E:\wwwroot\shopify-app\learn-app\web> php artisan migrate
Migration Table Created Successfully.
Migrating: 2019_08_19_000000_create_failed_jobs_table
migrated: 2019_08_19_000000_create_failed_jobs_table (249.14ms)
Migrating: 2021_05_03_050717_create_sessions_table
migrated: 2021_05_03_050717_create_sessions_table (188.38ms)
Migrating: 2021_05_05_071311_add_scope_expires_access_token_to_sessions
migrated: 2021_05_05_071311_add_scope_expires_access_token_to_sessions (315.43ms)
Migrating: 2021_05_11_151158_add_online_access_info_to_sessions
migrated: 2021_05_11_151158_add_online_access_info_to_sessions (822.19ms)
Migrating: 2021_05_17_152611_change_sessions_user_id_type
migrated: 2021_05_17_152611_change_sessions_user_id_type (1,303.13ms)
PS e:\wwwroot\shopify-app\learn-app\web>

7. To start the local server for your application, run the following commands. as shown in Figure 7

要为您的应用启动本地服务器,请运行以下命令
Figure 7
PS E:\wwwroot\shopify-app\learn-app> yarn dev
YARN RUN v1.22.15
$ Shopify App Dev
✔ Dependencies installed

To run this command, log in to Shopify Partners.
👉Press any key to open the login page on your browser
✔ Logged in.

Looks like this is the first time youRe running dev for this project.
Configure your preferences by answering a few questions.

✔ App Name · Learn-App
✅ Success! Learn-App has been created on your partners account.
✔ using your default dev store (ShuiJingwanwq-development) to preview your project.
✅ Success! Converted shuijingwanwq-development.myshopify.com to a test store.

To make your local code access to your dev store, you need to use a shopify-trusted tunneling service called ngrok. to sign up and get an auth token:https://dashboard.ngrok.com/get-started/your-authtoken(​https://dashboard.ngrok.com/get-started/your-authtoken​)

✔ Enter your Ngrok token. · ********************************************
✅ Success! The tunnel is running and you can now view your app.

for your convenience, weve given your app a default url:https://4a94-66-175-216-239.ngrok.io.

You can update your apps url anytime in the partners dashboard (​https://partners.shopify.com/2442779/apps/12958171137/edit​).But once your app is live, update its URL will disrupt merchant access.

Shareable app url

https://4a94-66-175-216-239.ngrok.io?shop=shuijingwanwq-development.myshopify.com&host=c2h1aWppbmd3YW53cS1kZXZlbG9wbWVudC5teXNob3BpZnkuY29tL2FkbWlu

frontend |
frontend | > dev
frontend | > vite
frontend |
frontend |
Frontend | Vite v2.9.15 Dev Server running at:
frontend |
frontend | > network:http://192.168.56.1:57522/
frontend | > network:http://192.168.10.1:57522/
frontend | > network:http://192.168.89.86:57522/
frontend | > local:http://localhost:57522/
frontend | > network:http://172.17.176.1:57522/
frontend |
Frontend | Ready in 2602ms.
frontend |
backend | > composer\config::disableProcessTimeout
backend | > php artisan serve
Backend | Starting Laravel Development Server:http://127.0.0.1:57518
backend |[Fri Oct 14 16:52:21 2022]PHP 7.4.27 Development Server (http://127.0.0.1:57518)startedled

8. During the period, you need to enter the authtoken of ngrok. as shown in Figure 8

期间需要输入 ngrok 的 Authtoken
8

9. Start the Laravel development server:http://127.0.0.1:57518. Open in a browser. Error: Argument 1 Passed to Shopify\utils::sanitizeshopdomain() must be of the type string, null given, called in E:\wwwroot\shopify-app\learn-app\web\app\lib\authredirection.php on line 17 . The reason is that the parameter is not included in the URL: SHOP. as shown in Figure 9

启动 Laravel 开发服务器:http://127.0.0.1:57518 。在浏览器中打开。报错:Argument 1 passed to Shopify\Utils::sanitizeShopDomain() must be of the type string, null given, called in E:\wwwroot\shopify-app\learn-app\web\app\Lib\AuthRedirection.php on line 17 。原因在于未在网址中带上参数:shop
Figure 9

10. Install your app in the development store. Open the Shareable App URL:https://4a94-66-175-216-239.ngrok.io?shop=shuijingwanwq-development.myshopify.com&host=c2h1aWppbmd3YW53cS1kZXZlbG9wbWVudC5teXNob3BpZnkuY29tL2FkbWlu. When you open the URL, you will be prompted to install the application in the development store. Click Install App to install the app in the store. As shown in Figure 10

在开发商店中安装您的应用。打开 Shareable app URL:https://4a94-66-175-216-239.ngrok.io?shop=shuijingwanwq-development.myshopify.com&host=c2h1aWppbmd3YW53cS1kZXZlbG9wbWVudC5teXNob3BpZnkuY29tL2FkbWlu 。打开 URL 时,系统会提示您在开发商店中安装应用程序。单击安装应用程序以在商店中安装应用程序
Figure 10

11. Error during installation: Shopify\Exception\CookieNotFoundException could not find the current session id in the cookies. as shown in Figure 11

安装过程中报错:Shopify\Exception\CookieNotFoundException Could not find the current session id in the cookies
Figure 11

12. Start again from step 7 and skip step 9. You now have a development store with new apps installed. as shown in Figure 12

重新从第 7 步骤开始执行,跳过第 9 步骤。您现在有一个安装了新应用程序的开发商店
Figure 12

PHP / Laravel / Yii2 Legacy Project Maintenance & Long-Term Technical Support

If your PHP / Laravel / Yii2 project is already in production but needs bug fixing, API troubleshooting, performance optimization, developer handover support, or long-term maintenance, feel free to contact me for remote technical support.

Ideal For:
✅ PHP legacy systems without active maintenance
✅ Laravel / Yii2 project bug fixes
✅ Admin panel feature iterations
✅ RESTful API troubleshooting
✅ MySQL / Redis / Nginx performance issues
✅ Long-term remote part-time maintenance

We can start with a small task:
✅ Production error troubleshooting
✅ API issue analysis
✅ Slow query and performance bottleneck diagnosis
✅ Initial code structure review
✅ Deployment environment and log inspection

If you would like to discuss your project, please contact me and mention: PHP Maintenance Consultation.

Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.