Laravel Local Package Dependency Issues - laravel

In my main composer.json file in the root of my Laravel app I have the following:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"guzzlehttp/guzzle": "~5.3|~6.0",
"company/package": "dev"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Company\\Package\\": "packages/company/package/src"
}
},
Then in my package's composer.json file I have this line:
"require": {
"zizaco/entrust": "5.2.x-dev"
},
"minimum-stability": "dev"
When I run composer update from the root directory, I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- company/package dev-feature/auth requires zizaco/entrust 5.2.x-dev -> satisfiable by zizaco/entrust[5.2.x-dev] but these conflict with your r
equirements or minimum-stability.
- company/package dev-feature/auth requires zizaco/entrust 5.2.x-dev -> satisfiable by zizaco/entrust[5.2.x-dev] but these conflict with your r
equirements or minimum-stability.
- Installation request for company/package dev-feature/auth -> satisfiable by company/package[dev-feature/auth].
I am not sure exactly what is happening? What exactly is the constraint or requirement that is the causing the problem?

I believe I found the issue. In my root composer.json file I changed the following and now it works:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"guzzlehttp/guzzle": "~5.3|~6.0",
"company/package": "dev-auth"
},

Related

I got symfony/console errors when installed botman/botman into new laravel app?

I try to add botman/botman into my new laravel app, which I created with command :
laravel new LrBtmn
But I got error :
master#master-at-home:/_wwwroot/lar/LrBtmn$ php artisan --version
Laravel Framework 9.47.0
master#master-at-home:/_wwwroot/lar/LrBtmn$ composer global require "botman/installer"
Changed current directory to /home/master/.config/composer
Using version ^1.0 for botman/installer
./composer.json has been updated
Running composer update botman/installer
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- botman/installer[1.0.0, ..., 1.0.3] require symfony/console ~2.3|~3.0 -> found symfony/console[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47] but the package is fixed to v6.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- botman/installer 1.0.4 requires symfony/console ~2.3|~3.0|~4.0 -> found symfony/console[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.49] but the package is fixed to v6.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires botman/installer ^1.0 -> satisfiable by botman/installer[1.0.0, ..., 1.0.4].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require botman/installer:*" to figure out if any version is installable, or "composer require botman/installer:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I tried to add "-W" key :
master#master-at-home:/_wwwroot/lar/LrBtmn$ composer global require "botman/installer" -W
Changed current directory to /home/master/.config/composer
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^1.0 for botman/installer
./composer.json has been updated
Running composer update botman/installer --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- botman/installer[1.0.0, ..., 1.0.3] require symfony/console ~2.3|~3.0 -> found symfony/console[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47] but these were not loaded, likely because it conflicts with another require.
- botman/installer 1.0.4 requires symfony/console ~2.3|~3.0|~4.0 -> found symfony/console[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.49] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires botman/installer ^1.0 -> satisfiable by botman/installer[1.0.0, ..., 1.0.4].
You can also try re-running composer require with an explicit version constraint, e.g. "composer require botman/installer:*" to figure out if any version is installable, or "composer require botman/installer:^2.1" if you know which you need.
In composer.json of new project there are no any "symfony/console" packages:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"botman/botman": "^2.7",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Which steps have I to take to run this app?
Thanks!

composer requires laravel/framework 5.5.32 -> satisfiable by laravel/framework[v5.5.32]

I'm trying to update my composers on my server.
Locally, I managed to update my composers without any problems, but on my server when I run my command for update
composer update
this gives me the following error:
Problem 1
- Root composer.json requires laravel/framework 5.5.32 -> satisfiable by laravel/framework[v5.5.32].
- laracasts/generators dev-master requires illuminate/support ~6.0|~7.0|~8.0 -> satisfiable by illuminate/support[v6.0.0, ..., v6.20.16, v7.0.0, ..., v7.30.4, v8.0.0, ..., v8.28.1].
- Only one of these can be installed: illuminate/support[v4.0.0, ..., v4.2.17, v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.16, v7.0.0, ..., v7.30.4, v8.0.0, ..., v8.28.1], laravel/framework[v5.5.32]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laracasts/generators dev-master as 1.1.4 -> satisfiable by laracasts/generators[dev-master].
And here is my composer.json :
{
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.5.32",
...
"spatie/laravel-newsletter": "^4.2.1",
"spatie/laravel-cookie-consent": "2.11.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"laracasts/generators": "dev-master as 1.1.4",
"backpack/generators": "^1.1",
"filp/whoops": "~2.0",
"barryvdh/laravel-debugbar": "^3.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Http/helpers.php"
]
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"config": {
"preferred-install": "dist"
}
}
You have an error in your packages. Some packages require Laravel 5.5

updating composer / installing a new package conflicting packages

I wanted to install a new package in a Laravel 7 application. I have tried direct composer require command and tried manually entering package name and updating composer command but both times it returns error as follows.
while using command 'composer require simplesoftwareio/simple-qrcode'
Problem 1
- chumper/zipper v1.0.0 requires illuminate/support 5.x -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
- chumper/zipper[v1.0.1, ..., v1.0.3] require illuminate/support ^5.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires chumper/zipper ^1.0 -> satisfiable by chumper/zipper[v1.0.0, v1.0.1, v1.0.2, v1.0.3].
while using command 'composer update'(with or without writing the new package details)
Problem 1
- Root composer.json requires robincsamuel/laravel-msg91 dev-master -> satisfiable by robincsamuel/laravel-msg91[dev-master].
- robincsamuel/laravel-msg91 dev-master requires guzzlehttp/guzzle ^7.0.1 -> found guzzlehttp/guzzle[dev-master, 7.0.1, ..., 7.2.0] but it conflicts with your root composer.json require (~6.0)
Problem 2
- Conclusion: don't install chumper/zipper v1.0.1 (conflict analysis result)
- Conclusion: don't install chumper/zipper v1.0.2 (conflict analysis result)
- Conclusion: don't install chumper/zipper v1.0.3 (conflict analysis result)
- Root composer.json requires chumper/zipper ^1.0 -> satisfiable by chumper/zipper[v1.0.0, v1.0.1, v1.0.2, v1.0.3].
- Conclusion: don't install laravel/framework v7.0.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v7.0.2 (conflict analysis result)
.........
- Conclusion: don't install laravel/framework v7.30.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v7.30.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v7.30.3 (conflict analysis result)
- Conclusion: don't install laravel/framework v7.0.0 (conflict analysis result)
- chumper/zipper v1.0.0 requires illuminate/support 5.x -> satisfiable by illuminate/support[v5.0.0, ..., 5.8.x-dev].
- Only one of these can be installed: illuminate/support[dev-master, v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev], laravel/framework[v7.0.0, ..., 7.x-dev]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laravel/framework ^7.0 -> satisfiable by laravel/framework[v7.0.0, ..., 7.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
my composer.json file is as followed:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4.5",
"africastalking/africastalking": "^2.3",
"anhskohbo/no-captcha": "^3.2",
"barryvdh/laravel-dompdf": "^0.8.6",
"bigbharatjain/laravel-clickatell": "^1.0",
"brian2694/laravel-toastr": "^5.53",
"simplesoftwareio/simple-qrcode": "^4.1",
"chumper/zipper": "^1.0",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"fzaninotto/faker": "^1.9",
"guzzlehttp/guzzle": "~6.0",
"intervention/image": "^2.5",
"jenssegers/agent": "^2.6",
"laravel/framework": "^7.0",
"laravel/passport": "^9.3.2",
"laravel/tinker": "^2.0",
"laravelcollective/html": "^6.1",
"maatwebsite/excel": "^3.1",
"macsidigital/laravel-api-client": "^3.0",
"macsidigital/laravel-zoom": "^4.0",
"macsidigital/zoom": "^0.0.5",
"nwidart/laravel-modules": "^7.1",
"paypal/rest-api-sdk-php": "^1.14",
"phpmailer/phpmailer": "^6.0",
"rahulreghunath/textlocal": "^1.0",
"renatomarinho/laravel-page-speed": "^1.8",
"robincsamuel/laravel-msg91": "dev-master",
"stripe/stripe-php": "^7.37",
"symfony/polyfill-php70": "^1.18.1",
"twilio/sdk": "^5.31",
"unicodeveloper/laravel-paystack": "^1.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.3",
"facade/ignition": "^2.0",
"laravel/ui": "~2.0",
"mockery/mockery": "^1.3.1",
"mpociot/laravel-apidoc-generator": "^4.8",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": [
"laravel/telescope"
]
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/"
},
"classmap": [
"database/seeds",
"database/factories"
],
"files": [
"app/Helpers/Helper.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
Please help me resolve this problem I am hard stuck here for hours with no proper solution I could find on internet.
chumper/zipper v1.0.0 requires illuminate/support 5.x is the most important part of that output: the given package is only compatibel with Laravel v5, while your composer.json contains the requirement "laravel/framework": "^7.0"

How to upgrade Laravel from 5.7 to 5.8

I have been googling and reading on this for several days.
I am unable to update my Laravel project from 5.7 to 5.8, due to dependencies. When I update the dependency package version values in composer.json and try to perform a laravel update, it ignores my updates, and actually reverts them back to the original values.
Composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"anhskohbo/no-captcha": "^3.0",
"chriskonnertz/open-graph": "^1.0",
"cmgmyr/messenger": "^2.16",
"cviebrock/eloquent-sluggable": "^4.6",
"doctrine/dbal": "^2.8",
"egeloen/http-adapter": "^1.0",
"eilander/gateway": "^5.6",
"exodusanto/administrator": " 5.7.*",
"fideloper/proxy": "^4.0",
"fzaninotto/faker": "^1.8",
"geocoder-php/bing-maps-provider": "^4.0",
"geocoder-php/chain-provider": "^4.0",
"geocoder-php/google-maps-provider": "^4.2",
"geoip2/geoip2": "^2.9",
"hemp/presenter": "^1.0",
"hieu-le/active": "^3.5",
"htmlmin/htmlmin": "^5.8",
"intervention/image": "^2.4",
"laravel/framework": "5.7.*",
"laravel/passport": "^7.0",
"laravel/socialite": "^4.1",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.7",
"league/period": "4.1.0",
"maatwebsite/excel": "^3.1",
"morrislaptop/laravel-queue-clear": "^1.1",
"php-http/guzzle6-adapter": "^1.1",
"php-http/message": "^1.7",
"phpoffice/phpspreadsheet": "^1.5",
"pragmarx/firewall": "^2.2",
"predis/predis": "^1.1",
"prettus/l5-repository": "^2.6",
"prettus/laravel-validation": "^1.1",
"ryanwinchester/hubspot-php": "~1.0",
"sammyk/laravel-facebook-sdk": "^3.5",
"santigarcor/laratrust": "^5.0",
"spatie/laravel-newsletter": "^4.2",
"toin0u/geocoder-laravel": "^4.0",
"torann/geoip": "^1.0",
"venturecraft/revisionable": "^1.28",
"watson/sitemap": "^2.0",
"yajra/laravel-datatables-oracle": "^8.9"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Steps I take:
1) Edit my composer.json file, changing: "laravel/framework": "5.7."
to: "laravel/framework": "5.8."
2) Run composer update
Output:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: anhskohbo/no-captcha
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: chriskonnertz/open-graph
Discovered Package: cmgmyr/messenger
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: exodusanto/administrator
Discovered Package: fideloper/proxy
Discovered Package: hemp/presenter
Discovered Package: hieu-le/active
Discovered Package: htmlmin/htmlmin
Discovered Package: intervention/image
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/passport
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: maatwebsite/excel
Discovered Package: morrislaptop/laravel-queue-clear
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: pragmarx/firewall
Discovered Package: prettus/l5-repository
Discovered Package: sammyk/laravel-facebook-sdk
Discovered Package: santigarcor/laratrust
Discovered Package: spatie/laravel-newsletter
Discovered Package: toin0u/geocoder-laravel
Discovered Package: torann/geoip
Discovered Package: watson/sitemap
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.
Result:
composer.json file has been reset to show : "laravel/framework": "5.7.*"
Things I've tried:
1) Deleting the composer.lock file prior to attempting this.
2) Performing a php artisan cache:clear prior to my updates.
There has to be someone out there who has experienced these issues that can help me out.
Just follow the Official Upgrade Guide:
Update your composer.json laravel/framework to 5.8.*
Run composer update. There's no need to deleting `composer.lock
Check the upgrade guide above for changes that might affect uour application. This version have almost no breaking changes.
Turns out the IDE (Eclipse Neon) was never updating my composer.json file even though it indicated I was. I edited it from the command line, and it worked.
My personal experiences in this sort of situations has learned me to create a brand new project with new version of Laravel and then add my personal changes (i.e. controllers, models, migrations, views, configurations, etc.). Of course using unit tests will help you a lot to successfully upgrade your project to the next level.
BTW. this link may help you to upgrade safely but again, I highly recommend to use a brand new installation instead of dealing with a mess of changes.

Installation via Composer receives an error with certain dependencies

I'm trying to initialize my symfony project via composer.
But I obtain the following error:
Problem 1
- Installation request for pugx/shortid-php 1.* -> satisfiable by pugx/shortid-php[1.0.x-dev].
- pugx/shortid-php 1.0.x-dev requires php ^7.1 -> your PHP version (5.4.45) does not satisfy that requirement.
Problem 2
- Installation request for pugx/shortid-doctrine 1.* -> satisfiable by pugx/shortid-doctrine[1.0.x-dev].
- pugx/shortid-doctrine 1.0.x-dev requires pugx/shortid-php ^0.5 -> satisfiable by pugx/shortid-php[v0.5.0] but these conflict with your requirements or minimum-stability.
Problem 3
- Installation request for pugx/shortid-doctrine-bundle 1.* -> satisfiable by pugx/shortid-doctrine-bundle[1.0.x-dev].
- pugx/shortid-doctrine-bundle 1.0.x-dev requires pugx/shortid-doctrine ^0.4 -> satisfiable by pugx/shortid-doctrine[v0.4.0] but these conflict with your requirements or minimum-stability.
I'm working with PHP 5.4
Below I show an excerpt of my composer.json:
{
...
"autoload": {
"psr-4": { "": "src/" }
},
"require": {
"php": "^5.4",
"symfony/symfony": "~2.7",
"doctrine/orm": "~2.5",
"doctrine/doctrine-bundle": "~1.4",
"twig/extensions": "~1.0",
"pugx/shortid-php": "1.*#dev",
"pugx/shortid-doctrine": "1.*#dev",
"pugx/shortid-doctrine-bundle": "1.*#dev",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/framework-extra-bundle": "~3.0",
"sensio/distribution-bundle": "~4.0",
"sensio/generator-bundle": "~2.3",
"jms/serializer": "0.16.0",
"justinrainbow/json-schema": "^5.2"
},
"require-dev": {
"beelab/test-bundle": "~1.0",
"doctrine/doctrine-fixtures-bundle": "2.2.*",
"incenteev/composer-parameter-handler": "~2.0",
"phpunit/phpunit": "4.*",
"fabpot/php-cs-fixer": "~1.5"
},
"config": {
"bin-dir": "bin"
},
...
}
How can I resolve these errors?
The error message says it all: pugx/shortid-php 1.0.x-dev requires php ^7.1
You will need to either upgrade your project to PHP 7.1 or replace the dependency with a version compatible with PHP 5.4.

Resources