概述
创建应用
composer加速
composer config -g repo.packagist composer https://packagist.laravel-china.org
创建 Laravel-Shop 项目
使用最新框架
composer create-project laravel/laravel laravel-shop
Creating a "laravel/laravel" project at "./laravel-shop"
Info from https://repo.packagist.org: #StandWithUkraine
Cannot use laravel/laravel's latest version v9.3.8 as it requires php ^8.0.2 which is not satisfied by your platform.
Installing laravel/laravel (v8.6.12)
- Installing laravel/laravel (v8.6.12): Extracting archive
Created project in D:phplaravel-shop
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Lock file operations: 102 installs, 0 updates, 0 removals
- Locking asm89/stack-cors (v2.1.1)
- Locking brick/math (0.9.3)
- 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 filp/whoops (2.14.5)
- Locking fruitcake/laravel-cors (v2.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/sanctum (v2.15.1)
- Locking laravel/serializable-closure (v1.2.2)
- Locking laravel/tinker (v2.7.2)
- Locking league/commonmark (1.6.7)
- 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 myclabs/deep-copy (1.11.0)
- Locking nesbot/carbon (2.62.1)
- 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 phpoption/phpoption (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/container (1.1.1)
- 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 ralouphie/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 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-grapheme (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.5.0)
- Locking voku/portable-ascii (1.6.1)
- Locking webmozart/assert (1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 102 installs, 0 updates, 0 removals
- Downloading symfony/var-dumper (v5.4.14)
- Downloading symfony/string (v5.4.14)
- Downloading symfony/console (v5.4.14)
- Downloading vlucas/phpdotenv (v5.5.0)
- Downloading symfony/mime (v5.4.14)
- Downloading symfony/http-foundation (v5.4.14)
- Downloading symfony/error-handler (v5.4.14)
- Downloading symfony/http-kernel (v5.4.14)
- Downloading symfony/translation (v5.4.14)
- Installing doctrine/inflector (2.0.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-grapheme (v1.26.0): Extracting archive
- Installing symfony/string (v5.4.14): Extracting archive
- Installing symfony/deprecation-contracts (v2.5.2): Extracting archive
- Installing psr/container (1.1.1): 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 psr/log (1.1.4): Extracting archive
- Installing monolog/monolog (2.8.0): Extracting archive
- Installing voku/portable-ascii (1.6.1): Extracting archive
- Installing phpoption/phpoption (1.9.0): Extracting archive
- Installing graham-campbell/result-type (v1.1.0): Extracting archive
- Installing vlucas/phpdotenv (v5.5.0): 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 brick/math (0.9.3): 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 league/commonmark (1.6.7): Extracting archive
- Installing laravel/serializable-closure (v1.2.2): 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 asm89/stack-cors (v2.1.1): Extracting archive
- Installing fruitcake/laravel-cors (v2.2.0): Extracting archive
- Installing psr/http-message (1.0.1): Extracting archive
- Installing psr/http-client (1.0.1): Extracting archive
- Installing ralouphie/getallheaders (3.0.3): Extracting archive
- Installing psr/http-factory (1.0.1): Extracting archive
- Installing guzzlehttp/psr7 (2.4.1): Extracting archive
- Installing guzzlehttp/promises (1.5.2): Extracting archive
- Installing guzzlehttp/guzzle (7.5.0): Extracting archive
- Installing laravel/sail (v1.16.2): Extracting archive
- Installing laravel/sanctum (v2.15.1): 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 phpunit/php-invoker (3.1.1): Extracting archive
- Installing phpunit/php-file-iterator (3.0.6): 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 myclabs/deep-copy (1.11.0): Extracting archive
- Installing doctrine/instantiator (1.4.1): Extracting archive
- Installing phpunit/phpunit (9.5.25): Extracting archive
77 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating optimized autoload files
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/sail
Discovered Package: laravel/sanctum
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
76 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force
No publishable resources for tag [laravel-assets].
Publishing complete.
No security vulnerability advisories found
> @php artisan key:generate --ansi
Application key set successfully.
配置 .env
APP_NAME=三体-商城
APP_ENV=local
APP_KEY=base64:02I1ujvlc281p7aLCE2yK8QSeMMD7O2x1ANzZTCusqk=
APP_DEBUG=true
APP_URL=http://threebody.local
数据库
DB_CONNECTION=mysql
DB_HOST=192.168.2.206
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=mySql@passWord
git版本控制
git init
git add -A
git commit -m "初始化三体商城"
git push -u origin master
Laravel 默认的 .gitignore 文件并没有把 public/js 和 public/css 目录排除掉,前端编译后的 JS 和 CSS 文件会被放到这两个目录中,而编译后的文件是不需要加入到版本库的,因此先编辑 .gitignore 文件
最后
以上就是顺心外套为你收集整理的lararvel-shop 创建应用创建应用的全部内容,希望文章能够帮你解决lararvel-shop 创建应用创建应用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复