when i want to install LaravelShoppingcart , with composer :
$ composer require gloudemans/shoppingcart
This return errors.Because composer update laravel version 5.5 to 5.6 and ShoppingCart not work 5.6 yet.How can i install this package with dont update composer ?
You either need to use Laravel 5.5 or fork the package and bump the version dependencies yourself:
// composer.json, 5.5 is the highest supported version
"require": {
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*",
"illuminate/session": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*",
"illuminate/events": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*"
},
There is a passing pull request in place though:
https://github.com/Crinsane/LaravelShoppingcart/pull/425
However, if you can't wait for the pull request to be accepted, the change is trivial.
Fork the package
Update composer.json
:
"require": {
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*",
"illuminate/session": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*",
"illuminate/events": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*"
},
"require-dev": {
"phpunit/phpunit": "~5.0|~6.0|~7.0",
"mockery/mockery": "~0.9.0",
"orchestra/testbench": "~3.1"
},
Commit the changes.
Create a release of your new fork.
Create a release in GitHub
You now have a released version in your personal GitHub account which you can instruct composer to use for installation.
Install the fork using composer
In the repositories section of your composer.json
add your public GitHub repository:
// "repositories" may not exist in your composer.json file.
// add it as a sibling to "require"
"repositories": [
{
"type": "git",
"url": "https://github.com/username/forked-repository"
}
],
and add an entry to the require section:
// change the version - 2.4.6 - to match your fork's version
"require": {
"username/forked-repository": "2.4.6"
}
You can now run:
composer update
and the fork will be installed in your application.