在您的composer.json
文件中,将以下内容添加到该require
部分(请注意,与您当前列出的内容相比,该部分*
在符号前有一个星号@
):
"laravel/spark": "*@dev"
然后将其添加到它自己的部分(或相应地更新):
"repositories": [
{
"type": "path",
"url": "./spark",
"options": {
"symlink": false
}
}
],
该options
部分是可选的,您可以将其省略
然后,您可以运行您的composer install
命令。你可以通过运行来确认一切正常composer validate
,这会触发一个警告,忽略它也没关系。您还应该检查composer.lock
文件以确保其中有类似的内容:
{
"name": "laravel/spark",
"version": "dev-develop",
"dist": {
"type": "path",
"url": "./spark",
"reference": "072b0bf217fbbe5018fc062612bb1fb5566d94e1",
"shasum": null
},
"require": {
"erusev/parsedown": "~1.0",
"firebase/php-jwt": "~3.0|~4.0",
"guzzlehttp/guzzle": "~6.0",
"intervention/image": "^2.3",
"php": ">=5.5.9",
"ramsey/uuid": "^3.1"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"mpociot/vat-calculator": "^1.6",
"phpunit/phpunit": "~5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"autoload": {
"psr-4": {
"Laravel\\Spark\\": "src/"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
}
],
"description": "Laravel Spark provides scaffolding for Laravel SaaS applications.",
"keywords": [
"billing",
"laravel",
"saas",
"scaffolding",
"stripe"
],
"transport-options": {
"symlink": false
}
},
此外,根据您的版本和设置方式,您必须查看文档,因为有几种不同的设置方法:
https://spark.laravel.com/docs/6.0/installation#installation-via-composer
我还要补充一点,您永远不应该修改目录中的./spark
文件。所有更改都在./resources/assets/js/spark
or中进行./resources/views/vendor/spark
(并且一如既往,您可以覆盖app
目录中的任何内容,除非您更改了命名空间)。
哦,这些命令可能对您有用(显然将它们转换为实际的别名或带别名的函数):
alias reset
rm -rf composer.lock node_modules package-lock.json vendor
composer install
npm install
gulp
composer validate
alias update
rm -rf node_modules vendor
composer install
npm install
composer update
npm update
reset
不过,我只会将它们作为分支主机运行,团队成员不必为 Composer 和 npm 进行依赖项更新。