Resolving Dependency Conflicts Installing Behat and Laravel 5.3 - composer-php

Hello I am trying to install behat/behat via composer, however I am have dependency problems. I tried the below of many:
composer require behat/behat:"3.*" symfony/dependency-injection:"3.*" --dev
However, the output of above is
Your requirements could not be resolved to an installable set of packages.
Below is my composer.json file.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.3.*",
"dingo/api": "1.0.*#dev",
"tymon/jwt-auth": "0.5.11",
"phaza/laravel-postgis": "^3.0",
"jenssegers/raven": "1.9.0",
"guzzlehttp/guzzle": "~5.3|~6.0",
"oureastudios/laravel5-braintree": "dev-master",
"vinkla/algolia": "^2.1",
"alexpechkarev/google-maps": "1.0.5",
"pda/pheanstalk": "~3.0",
"league/flysystem-aws-s3-v3": "~1.0",
"pubnub/pubnub": "3.7.*",
"maknz/slack": "^1.7",
"intervention/image": "^2.3",
"wilgucki/csv": "^0.5.1",
"doctrine/dbal": "^2.5",
"davibennun/laravel-push-notification": "#dev",
"aloha/twilio": "^2.1",
"laravel/socialite": "^2.0",
"barryvdh/laravel-dompdf": "^0.8.0",
"mockery/mockery": "1.0",
"maxmind-db/reader": "~1.0",
"predis/predis": "^1.1"
},
"require-dev": {
"symfony/dom-crawler": "~3.1",
"symfony/css-selector": "~3.1",
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~5.0",
"phpspec/phpspec": "~2.1",
"johnkary/phpunit-speedtrap": "^1.0",
"barryvdh/laravel-ide-helper": "^2.4"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php",
"tests/Helpers/",
"tests/Traits/"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled",
"php artisan ide-helper:generate",
"php artisan ide-helper:models -N",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
What combination of behat and symfony/dependency-injection I should install? I tried many versions ever issued the below command
composer info behat/behat -a but still no avail.

Basically whenever you get into this dependency nightmare, you are highly recommended to make your required versions specific rather than with wildcards. In other words: give Composer less room for imagination.
This is what I did to make it work:
1. Guess which is the best fit
Laravel 5.3 was released back in September 9, 2016, going over the Behat releases, the first major release before that was 3.1.0 which was released in march 28th, 2016. So that's the first version I put in Composer directly (ie. without any wildcards and such) like so:
"behat/behat": "3.1.0",
2. Run Stuff With No Strings Attached
After that, I just ran the following:
composer dump-autoload: clean up caches
rm -rf vendor and rm composer.lock: just to make life easier
composer install --no-scripts: just to make sure that php artisan stuff don't run.
profit
composer show | grep behat
behat/behat v3.1.0 Scenario-oriented BDD framework for PHP 5.3
behat/gherkin v4.5.1 Gherkin DSL parser for PHP 5.3
behat/transliterator v1.2.0 String transliterator

Related

Upgrade Laravel version from 5.2.45 to 5.4

I am working on an existing application and the application is in laravel framework(version 5.2.45).And now i have to upgrade it to the version(5.4).I have follow the upgrade version step from laravel official documentation. Below is the steps which i have done :
1) Update the version number in laravel composer.json file in "laravel/framework" key.
2) Then after run the command composer update.
3) After that during executing the command i face error and the solution of that is to add the below line in composer.json file.
"minimum-stability": "dev",
"prefer-stable": true,
4) Then after again i execute the command composer update.Now i am facing the issue which i have attached in the below image :
Here is the code of composer.json file :
{
"name": "ozdemirburak/laravel-5-simple-cms",
"description": "Simple Laravel 5 content management system for starters.",
"keywords": [
"framework",
"laravel",
"cms"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.4.*",
"laravelcollective/html": "5.2.*",
"baum/baum": "~1.1",
"kris/laravel-form-builder": "1.6.*",
"laracasts/flash": "~1.3",
"mews/purifier": "~2.0",
"cviebrock/eloquent-sluggable": "~3.1.4",
"barryvdh/laravel-elfinder": "0.3.*",
"spatie/laravel-analytics": "~1.1",
"yajra/laravel-datatables-oracle": "~6.0",
"pingpong/modules": "~2.1",
"caffeinated/menus": "~2.0",
"fisharebest/laravel-assets": "~1.0",
"caffeinated/themes": "2.0.5",
"teepluss/theme": "dev-master",
"roumen/sitemap": "2.6.*",
"maatwebsite/excel": "^2.1",
"intervention/image": "^2.3",
"laravel/socialite": "^2.0",
"xinax/laravel-gettext": "^3.1",
"omnipay/paypal": " *",
"mews/captcha": "^2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*",
"phpspec/phpspec": "~2.1",
"doctrine/dbal": "~2.5",
"squizlabs/php_codesniffer": "~1.5",
"laracasts/generators": "~1.1.3",
"barryvdh/laravel-ide-helper": "~2.0",
"barryvdh/laravel-debugbar": "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "modules/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"php artisan elfinder:publish"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist"
}
}
Note : For the current error i also found a solution in the stackoverflow and i implement that thing but still i am getting this error.
Thanks in advance!
You should update step by step, in your case update to 5.2 => 5.3 and after that 5.3 => 5.4 Please check laravel official documentation.
According to the error output:
"caffeinated/themes": "2.0.5" is locked to Laravel 5.1/5.2.
Upgrade that first.
Then the rest should follow.

Updating laravel to laravel 5.5 from laravel 5.4

I'm trying update a laravel from 5.4 version to 5.5. I have done everything with instruction from laravel guide:
https://laravel.com/docs/master/upgrade
When I'm trying use command:
composer update
the result is:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package laravel/framework 5.5.* is satisfiable by laravel/framework[5.5.x-dev] but these conflict with your requirements or minimum-stability.
Below I show composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"doctrine/dbal": "^2.5",
"intervention/image": "^2.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.4.0",
"unisharp/laravel-filemanager": "^1.7"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"artSite\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
I would be greateful for help. Best regards
as stated in the error message Laravel 5.5 is still in dev, meaning there's no stable release and by default Composer limits you to downloading only stable numbered releases to avoid you downloading any packages that are in active development and may contain breaking changes.
You can circumvent this by adding the following two lines to your composer.json file
"minimum-stability": "dev",
"prefer-stable": true,
This way it prefers stable releases wherever it can find them but it will allow you to download dev packages if nothing else is available.
I think you should update the PHP version as well. If you check the official doc, it says the minimum PHP requirement 7.0.0.

Laravel: Update from 5.2.12 to 5.2.31

I have a Laravel 5.2.12 project (website), it's a big project and it's almost finished... Is there any simple way to update the Laravel from 5.2.12 to 5.2.31 without affecting the project (without affecting what was already done)? How can I do this?
So, the question is how to update the version of Laravel on existing project from 5.2.12 to 5.2.31?
EDIT: Here is my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"cartalyst/sentinel": "2.0.*",
"intervention/image": "^2.3",
"barryvdh/laravel-debugbar": "^2.2",
"slynova/laravel-commentable": "^2.0",
"barryvdh/laravel-ide-helper": "v2.2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
What should be changed to update just Laravel to 5.2.31 (to the latest 5.2 version)?
Update composer.json to use laravel\laravel on the version you would like. Then run composer update in you command line.
Your project should not have any issues updating from 5.2.12 to 5.2.31 since they are mostly bugfixes. But do note that other dependencies might update to a new version. So you might want to set them to a fixed version in your composer.json file if the cause hickups.

Laravel Upgrading To 5.2.0 From 5.1 error

Getting the error on composer update command.
My composer.json file is:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"illuminate/html": "^5.0",
"barryvdh/laravel-debugbar": "~2.0",
"spatie/laravel-paginateroute": "^2.0",
"darkaonline/l5-swagger": "~2.0",
"yajra/laravel-datatables-oracle": "~5.0",
"phpoffice/phpexcel": "^1.8"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0"
},
"autoload": {
"classmap": [
"database"
],
"files": ["app/Helpers/helpers.php"],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
You need to remove this outdated package (taken out of the core and no longer supported):
"illuminate/html": "^5.0",
When you remove it, you need to also remove its service providers / aliases. So, if you open up config/app.php, you will see a providers and aliases section. Remove these lines of code if you haven't done so already.
'Illuminate\Html\HtmlServiceProvider'
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade',
In place of it, you should install the Laravel collective package. To install that, replace the illuminate/html package with this:
"laravelcollective/html": "5.2.*"
Then in your config/app.php file, add this to your providers array:
Collective\Html\HtmlServiceProvider::class
and this to your aliases array:
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
The docs can be found here: https://laravelcollective.com/docs/5.2/html
Look at this
https://laracasts.com/discuss/channels/laravel/call-to-undefined-method-illuminatefoundationapplicationbindshared
Quote "bindShared has been renamed to $app->singleton()"
[Edit]
I think you have something is your own custom code what need to be changed from : $this->app->bindShared() to: $this->app->singleton().
I solved it by the steps mentioned in Link1 Link2
After the upgrade please make sure all the Deprecations mentioned in Link2 are corrected in your current app. For me Illuminate\Contracts\Routing\Middleware had to be removed from all the Middlewares.
Also I had to install latest version of certain packages like "yajra/laravel-datatables-oracle": "~6.1.1",

plivo api intallation via composer conflict with guzzle

I am installating plivo api using composer on live server(digital ocean), which running command i getting some dependencies version mismatch errors.
plivo required guzzle latest version, but guzzle is already installed in my laravel application but its version is old.What i need to do to resolve this error.
please help me to resolve those.
here is the composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"laracasts/flash": "^1.3",
"fzaninotto/faker": "~1.4",
"barryvdh/laravel-debugbar": "~2.0",
"orchestra/imagine": "~3.0",
"zendframework/zendsearch": "dev-master",
"mmanos/laravel-search": "dev-master",
"dimsav/laravel-translatable": "~5.0",
"twilio/sdk": "*",
"fillup/nexmo": "dev-master",
"guzzlehttp/log-subscriber": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"illuminate/html": "~5.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Lib\\": "lib/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}}
here is the screen shot
Plivo Sales Engineer here.
You should not use guzzlehttp/log-subscriber (it is depreciated as noted in the comments) but rather use any logger which implements a PSR-3 interface. See this SO post for how to do it with the builtin guzzle middleware and monolog or there is also the guzzle-log-middleware.
One other note: the latest version of plivo-php is 1.1.0. I'd encourage you to use that. It requires Guzzle v6.1.1.
According to plivo/plivo-php, it requires Guzzle v6.1.
guzzlehttp\log-subscriber is only compatible with Guzzle v4 and v5.
If you are attempting to log the Request or Response you can use GuzzleHttp\Middleware::log

Resources