Composer cannot find path repo - Laravel spark - laravel

So, Laravel spark isn't letting me connect to the github any more and it's causing me to be unable to push to heroku and completely halting my work. I tried placing the spark code in a folder and then making the code path repository. However, when I run composer update it still tries to fetch the code from the same github location. Seems like it isn't finding the repo.
I have tried tons of path variations and placing the code in various locations. Here is the section from the composer:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravel/spark":"*",
....
"repositories": [
{
"type": "path",
"url": "vendor/laravel/spark"
},
{
"type": "composer",
"url": "https://spark-satis.laravel.com"
}
],
And, in the package composer ...
"name": "laravel/spark",
"description": "Laravel Spark provides scaffolding for Laravel SaaS applications.",
"keywords": ["laravel", "stripe", "billing", "scaffolding", "saas"],
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell#gmail.com"
}
],
"require": {
"php": ">=5.5.9",
"erusev/parsedown": "~1.0",
"firebase/php-jwt": "~3.0",
"guzzlehttp/guzzle": "~6.0",
"ramsey/uuid": "^3.1",
"intervention/image": "^2.3"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"mpociot/vat-calculator": "^1.6"
},
"autoload": {
"psr-4": {
"Laravel\\Spark\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"minimum-stability": "dev"
Is there something that I am missing to ensure that composer uses the path repo instead of looking at github?

Push laravel/spark code to your own git repo, than inside composer.json use
"repositories": [
{
"type": "vcs",
"url": "https://path to your repo"
}
],
and run composer require laravel/spark, It should take the code from your repo

Since laravel/spark is not free anymore and cannot be installed or updated with composer
You have to purchase license version to use it.
https://spark.laravel.com/licenses

Related

Composer Refusing to Use GitHub Branch

I'm trying to get Composer to install the 3.0.0 branch of a GitHub project (onelogin/php-saml). However, no matter what I try, it keeps trying to install the master branch version (2.12). Am I missing something? Below is my composer.json
{
"name": "munkireport/munkireport-php",
"description": "Reporting tool for munki",
"type": "project",
"license": "MIT",
"require-dev": {
"squizlabs/php_codesniffer": "^2.5"
},
"require": {
"php": ">=7.0.27",
"ext-dom": "*",
"guzzlehttp/guzzle": "~6.0",
"hautelook/phpass": "^1.1",
"illuminate/console": "~5.4",
"illuminate/database": "5.4.36",
"illuminate/filesystem": "~5.4",
"league/flysystem": "~1.0",
"rodneyrehm/plist": "^2.0",
"doctrine/dbal": "~2.5",
"defuse/php-encryption": "^2.1",
"onelogin/php-saml": "3.0.0-dev"
},
"suggest": {
"adldap2/adldap2": "^8.0 Required for AD authentication"
},
"autoload": {
"psr-4": {
"munkireport\\models\\": "app/models/",
"munkireport\\controller\\": "app/controllers",
"munkireport\\lib\\": "app/lib/munkireport"
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/onelogin/php-saml"
}
]
}
Output:
Using version ^2.12 for onelogin/php-saml
I was able to bypass this with the following command:
./composer require onelogin/php-saml:3.0.0.x-dev

Loading a composer package through a Github fork

I forked a library on Github and now want to load my fork into the project without adding the forked library into packagist. I get the following error after adding the repository and require to my composer.json:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cnizzardini/ssl-certificate could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Here is my full composer.json
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "~3.4",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"guzzlehttp/guzzle": "^6.2",
"donatj/phpuseragentparser": "^0.7.0",
"cnizzardini/ssl-certificate": "dev-master"
},
"require-dev": {
"psy/psysh": "#stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "~1.1",
"phpunit/phpunit": "^5.5"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src",
"Api\\": "./plugins/Api/src",
"Channel\\": "./plugins/Channel/src",
"System\\": "./plugins/System/src",
"Admin\\": "./plugins/Admin/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests",
"Api\\Test\\": "./plugins/Api/tests",
"Channel\\Test\\": "./plugins/Channel/tests",
"System\\Test\\": "./plugins/System/tests",
"Admin\\Test\\": "./plugins/Admin/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
"minimum-stability": "stable",
"prefer-stable": true
}
I have tried adding https://github.com/cnizzardini/ssl-certificate with and without the .git. I have also tried setting minimum-stability to dev and prefer-stable to false.
Nothing works :-(
The composer.json file on your fork still calls the package "spatie/ssl-certificate", so that's the name of the package you need to require.
This should work:
{
...
"require": {
...
"spatie/ssl-certificate": "dev-master"
},
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
...
}
If it doesn't, you can rename the package on your own fork by changing the name property in its composer.json file:
{
"name": "cnizzardini/ssl-certificate",
"description": "A class to easily query the properties of an ssl certificate ",
...
}

Composer won't install package dependencies

I have created composer package, which composer.json is
{
"name": "xxxx/yyyyy",
"description": "xyz",
"license": "MIT",
"authors": [
{
"name": "xxx",
"email": "xx#ttt.com"
}
],
"version": "1.0.0",
"type": "package",
"minimum-stability": "dev",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"tymon/jwt-auth": "0.5.*",
"dimsav/laravel-translatable": "^6.0",
"doctrine/dbal": "^2.5",
"felixkiss/uniquewith-validator": "2.*",
"owen-it/laravel-auditing": "^3.1",
"venturecraft/revisionable": "1.*",
"yadakhov/insert-on-duplicate-key": "^1.1"
},
"autoload": {
"psr-4": {
"XXX\\YYY\\" : "/src"
}
}
}
Now, when i install my
xxxx/yyyy
package, I need that composer install all required packages:
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"tymon/jwt-auth": "0.5.*",
"dimsav/laravel-translatable": "^6.0",
"doctrine/dbal": "^2.5",
"felixkiss/uniquewith-validator": "2.*",
"owen-it/laravel-auditing": "^3.1",
"venturecraft/revisionable": "1.*",
"yadakhov/insert-on-duplicate-key": "^1.1"
},
but it dont install it.
I try composer update, composer install. Can someone help?
Project Composer.json looks like
{
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"xxxx/yyyy" : "1.0.0"
},
"repositories": [
{
"type": "package",
"package": {
"name": "xxxx/yyyy",
"version": "1.0.0",
"source": {
"url": "example.com",
"type": "git",
"reference": "master"
},
"autoload": {
"psr-4" : {
"XXX\\YYY\\" : "/src"
}
}
}
}
]
}
What I can do, that Composer automatically install all package required dependencies???? Thanks for advice.
Don't use the package repository type. When you use this, you have to copy all information that usually resides inside the composer.json file of the software you are referencing.
package repositories are for scenarios where you are unable to add a composer.json file to the origin of the software. You have full control over your package, so this does not apply.
Just add a repository link of type vcs with the URL to the repository, and Composer will figure out the rest by looking at the composer.json file inside the repository. It will detect the dependencies and install them.

requested package laravel/spark could not be found in any version

I am trying to install laravel Spark but getting a lot of errors no matter which method I try.
Upon adding "laravel/spark": "*#dev" in the composer.js file I am getting this error.
The requested package laravel/spark could not be found in any version,
there may be a typo in the package name.
Any clue what the issue is?
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.",
"laravel/cashier": "~6.0",
"laravel/spark": "#dev"
}
Added to the composer.js file and ran composer update. Got the couldn't found error.
In your composer.json file, add the following to the require section (note that, compared to what you currently listed, this one has an asterisk * before the # symbol):
"laravel/spark": "*#dev"
Then add this in its own section (or update accordingly):
"repositories": [
{
"type": "path",
"url": "./spark",
"options": {
"symlink": false
}
}
],
The options portion is optional and you can leave it out
You can then run your composer install command. You can confirm that things are good by running composer validate, which will trigger a warning and it's fine to ignore that. You should also check the composer.lock file to make sure you have something similar to this in there:
{
"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
}
},
Also, depending on your version and how you set things up, you'll have to check on the documentation because there's a few different ways to set this up:
https://spark.laravel.com/docs/6.0/installation#installation-via-composer
I'd also add that, you should never modify files in the ./spark directory. All changes are made in either ./resources/assets/js/spark or ./resources/views/vendor/spark (and, as always, you can override anything in the app directory unless you changed the namespace).
Oh, and these commands may be useful for you (obviously turn these into an actual alias or function that's aliased):
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
I would only run these as the branch master though, team members shouldn't have to do dependency updates for Composer and npm.

Composer Installation in windows Error

Tried to install composer in windows through command line. Downloaded composer.phar. Placed it in C/wamp/www/s/ folder. During installation got this error.
[RuntimeException]
Error Output: make: *** No rule to make target `compile-json'. Stop.
What should I do now..?
This is my composer.json
{
"name": "aws/aws-sdk-php",
"homepage": "http://aws.amazon.com/sdkforphp",
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
"keywords": ["aws","amazon","sdk","s3","ec2","dynamodb","cloud","glacier"],
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "Amazon Web Services",
"homepage": "http://aws.amazon.com"
}
],
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues"
},
"require": {
"php": ">=5.5",
"guzzlehttp/guzzle": ">=5.3|~6.0.1|~6.1",
"guzzlehttp/guzzle":"~4.0",
"guzzlehttp/psr7": "~1.0",
"guzzlehttp/promises": "~1.0",
"mtdowling/jmespath.php": "~2.2"
},
"require-dev": {
"ext-openssl": "*",
"ext-pcre": "*",
"ext-spl": "*",
"ext-json": "*",
"ext-dom": "*",
"ext-simplexml": "*",
"phpunit/phpunit": "~4.0",
"behat/behat": "~3.0",
"doctrine/cache": "~1.4",
"aws/aws-php-sns-message-validator": "~1.0"
},
"suggest": {
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
"ext-curl": "To send requests using cURL",
"doctrine/cache": "To use the DoctrineCacheAdapter"
},
"autoload": {
"psr-4": {
"Aws\\": "src/"
},
"files": ["src/functions.php"]
},
"autoload-dev": {
"psr-4": {
"Aws\\Test\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"scripts": {
"post-autoload-dump": [
"make compile-json"
]
}
}
Thank you for posting your composer.json file.
The error comes from the following invalid entry:
"scripts": {
"post-autoload-dump": [
"make compile-json"
]
}
The make command will not work on Windows.
I suggest to simply remove this part of the file and try again.
(Its not clear to me, which of your project dependencies needs an additional make step and why you added it. Anyway this composer.json seems to be identical to https://github.com/aws/aws-sdk-php/blob/master/composer.json . If you want to contribute to this project ask them how to build on Windows :)
If you simply want to fetch the aws-sdk-php package.
Follow their installation guide: http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html
Use php composer.phar require aws/aws-sdk-php on the CLI.
Or add aws/aws-sdk-php to your require section and then run composer install, like so:
{
"require": {
"aws/aws-sdk-php": "^3.3"
}
}

Resources