I am trying to update the Laravel5.5 project to 6.
What I tried is first describing the package update
"php": "^7.2",
"ext-SimpleXML": "^7.3",
"barryvdh/laravel-ide-helper": "^2.6",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.0",
"jeroennoten/laravel-adminlte": "^2.0",
"laravel/framework": "^6.0",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^6.0",
"maatwebsite/excel": "^3.1",
"laravel/ui": "^1.1",
"phpoffice/phpspreadsheet": "^1.9",
"phpoffice/phpexcel": "dev-master"
next
composer update
I get error
Call to undefined function str_slug()
So install this library
composer require laravel/helpers
Then this error came out
JeroenNoten \ LaravelAdminLte \ ServiceProvider :: class, not found
Reinstalling adminLTE doesn't help, commenting out and reinstalling doesn't work, I'm stuck and want help
I need help
Click here to resolve this error: Call to undefined function str_slug()
Remove space in config/app.php file:
'providers' => [
....
JeroenNoten\LaravelAdminLte\ServiceProvider::class,
],
Just run this command, It can automatically add all configurations to your project:
composer require jeroennoten/laravel-adminlte
More info about jeroennoten/laravel-adminlte
Open the composer.json file of your project (The configuration file of Composer) and change the Laravel framework . (Notice the caret, Laravel 6 makes use of semantic versioning scheme).
you are recommended to first upgrade your project to 5.8 then again upgrade to v6.
Next, save your composer.json file and run the following command:
$ composer update
Before you upgrade your project to v6, make sure your upgrade your PHP version from 7.1 to at least 7.2.
starting from December 2019, PHP 7.1 will not be maintained.
Related
I am updating laravel to use php 8.2, according to laravel document here, using "laravel/framework": "^9.43" should be enough.
My composer.json are the following,
"require": {
"php": "^8.2",
"clue/socket-raw": "^1.3",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"gregwar/captcha": "1.*",
"guzzlehttp/guzzle": "^7.0.1",
"itsgoingd/clockwork": "^5.1",
"jacobcyl/ali-oss-storage": "^2.0",
"james-heinrich/getid3": "^1.9",
"laravel/framework": "^9.43",
"laravel/horizon": "^5.7",
"laravel/tinker": "^2.5",
"php-curl-class/php-curl-class": "^8.6"
},
But when running composer install --no-scripts --no-autoloader --no-dev (I don't use composer.lock here), composer complained,
laravel/framework[v9.43.0, ..., 9.x-dev] require dragonmantank/cron-expression ^3.3.2 -> found
dragonmantank/cron-expression[dev-set-up-semaphore,
dev-update-v3-php8, dev-master, dev-issue/35-fix-and-or-problem,
dev-allow-phpstan-failures, v1.0.0, ..., v1.2.1, v2.0.0, ...,
v2.3.1.x-dev, v3.0.0, ..., v3.3.1] but it does not match the
constraint.
I know laravel/framework 9 requires cron-expression ^3.3.2 as https://packagist.org/packages/laravel/framework said. But I can't figure out which other package requires a different version of cron-expression. I search the old composer.lock (which I don't use when install) I find multi-mention of dev-master, but no [dev-set-up-semaphore, dev-update-v3-php8, dev-issue/35-fix-and-or-problem, dev-allow-phpstan-failures]
Please check the following build log
How do I find that package ? BTW, php 8.1.7 + "laravel/framework" 8 works fine.
--- update ---
I find the reason why composer complains.
I have "require-dev" in my composer and all packages in it use the latest versions! I also check https://packagist.org/ to make sure they all say they support ^8.0. Besides, my command is composer install --no-scripts --no-autoloader --no-dev, no-dev !
So I didn't expect "require-dev" will cause problem. But only after I remove the "require-dev" did composer run successfully!
Apparently one of those packages do not support php 8.2 yet.
"require-dev": {
"facade/ignition": "^2.17",
"fakerphp/faker": "^1.21.0",
"laravel/sail": "^1.18.1",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^6.4",
"phpunit/phpunit": "^9.5.28"
}
After removing "facade/ignition" from "require-dev", composer finally works!
As for why does "facade/ignition" cause the problem and what is the solution for it, please refer to #NicoHaase's answer and my discussion with him.
"Apparently one of those packages do not support php 8.2 yet." - no, that's not the cause. Ignition does not support Laravel v9, as written in their readme:
If you're on Laravel 8 or above, you can switch to spatie/laravel-ignition, which is a drop-in replacement. Replace facade/ignition with "spatie/laravel-ignition": "^1.0" in your application's composer.json file.
Going forward, we'll only add security fixes to facade/ignition and highly encourage you to switch to spatie/laravel-ignition.
Use composer's why-not command:
composer why-not laravel/framework 9.43
At the moment I'm developing with Laravel and VueJs. I'm upgrading Laravel from 5.8 to 6.0 accordingly to the documentation.
It say's:
"Next, examine any 3rd party packages consumed by your application and
verify you are using the proper version for Laravel 6 support."
My package.json looks like this:
"require": {
"php": "^7.1.3", # [1] Successfully upgraded to 7.2
"barryvdh/laravel-cors": "^0.11.0",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0", # [2] Successfully upgradedto 6.0
"laravel/passport": "^9.3.2", # [3] Successfully upgradedto 9.3.2
"laravel/tinker": "^1.0",
"phpoffice/phpspreadsheet": "^1.4",
"pragmarx/version": "^0.2.8",
"pusher/pusher-php-server": "^3.4",
"santigarcor/laratrust": "5.2.*"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"orangehill/iseed": "^2.6",
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "3.*"
},
Now my question:
Is there a service (like a website) that I can use, to check if the package I want to update, got any breaking changes between my old and my new package version.
For example:
I want to upgrade barryvdh-laravel-cors from 0.11.0 to 2.0.4.
The documentation of barryvdh-laravel-cors have section for "Upgrading from 0.x / barryvdh-laravel-cors".
Is there an easier way, than go into the documentation every time and look up the breaking changes by myself?
Usually breaking changes managed by composer (by SemVer convention - https://semver.org/, all composer packages should follow it).
But, Laravel before version 6 is not following semver, so you need to check all your laravel-related packages manually, by inspecting package docs.
I am upgrading my laravel project to 5.6. current version is 5.5.38. my composer file is as below. when i run composer update, it does nothing but showing Loading composer repositories with package information
Updating dependencies (including require-dev) in the terminal for hours. what would be the issue for this?
"require": {
"php":">=7.1.3",
"laravel/framework": "5.6.*",
"fideloper/proxy" : "^4.0",
"guzzlehttp/guzzle": "~6.0",
"maatwebsite/excel": "v2.1.*",
"itsgoingd/clockwork": "1.*",
"barryvdh/laravel-ide-helper": "^2.2",
"anchu/ftp": "dev-master",
"pda/pheanstalk": "~3.0",
"nesbot/carbon": "1.20",
"laravelcollective/html": "~5.0",
"pusher/pusher-php-server": "~3.0",
"regulus/activity-log": "0.6.*",
"laravel/tinker": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"phpspec/phpspec": "~2.1",
"laracasts/generators": "^1.1",
"symfony/dom-crawler": "~3.1",
"symfony/css-selector": "~3.1",
"filp/whoops" : "~2.0"
},
The original poster fixed this by upgrading PHP, but for others (at time of writing, Laravel 5.5 is still the LTS version, so there will be many people upgrading from that soon), should Composer hang forever (as it did for me, despite running PHP 7.3):
A tip is to remove the entire require-dev section (the one that is only used on your dev environment) and see if it works, than add the packages back in again one at a time – on doing that, you might get an error like this with subsequent Composer commands (or more specifically, the Artisan commands, such as clear-compiled, that are launched by Composer):
In Application.php line 637:
Class 'Laracasts\Generators\GeneratorsServiceProvider' not found
…in which case, you probably need to comment out the appropriate line in app/Providers/AppServiceProvider.php::register() - also, try composer dump-autoload.
Another very useful option: composer-update --no-scripts
Laravel 5.6 now uses Symfony 4, not 3 (so you might switch to "~4.3")
There are some Symfony 4 requirements: https://symfony.com/doc/4.2/reference/requirements.html
Commit your existing copies of composer.json and composer.lock before you start, to make it easy to see what you've changed.
The problem is
I require blocktrail/blocktrail-sdk with composer on my laravel project and get these errors
Using version ^3.2 for blocktrail/blocktrail-sdk
./composer.json has been updated
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
- Installation request for paragonie/random_compat (locked at v9.99.99) -> satisfiable by paragonie/random_compat[v9.99.99].
- blocktrail/blocktrail-sdk v3.2.0 requires bitwasp/bitcoin v0.0.34.1 -> satisfiable by bitwasp/bitcoin[v0.0.34.1].
- blocktrail/blocktrail-sdk v3.2.1 requires bitwasp/bitcoin v0.0.34.1 -> satisfiable by bitwasp/bitcoin[v0.0.34.1].
- blocktrail/blocktrail-sdk v3.2.2 requires bitwasp/bitcoin v0.0.34.1 -> satisfiable by bitwasp/bitcoin[v0.0.34.1].
- Conclusion: don't install bitwasp/bitcoin v0.0.34.1
- Installation request for blocktrail/blocktrail-sdk ^3.2 -> satisfiable by blocktrail/blocktrail-sdk[v3.2.0, v3.2.1, v3.2.2].
Installation failed, reverting ./composer.json to its original content.
COMPOSER.JSON require and require-dev contents
"require": {
"php": "^7.1.3",
"bitwasp/bitcoin": "^0.0.34.1",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.0",
"laravel/framework": "5.7.*",
"laravel/socialite": "^3.1",
"laravel/tinker": "^1.0",
"paragonie/random_compat": "^2.0.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
What can I do ? I tried everything , no point
linux debian 8, php 7.2.9, laravel 5.7.5, thanks *
You need to redo some work here because it's a mess in dependencies where versions require symfony 3 and 4 at the same time (which will generate a conflict, that is not obvoius from the message you're getting right now). Same goes for deps for php 5.6 and 7.1 which are not fully compatible.
blocktrail-sdk-php already requires bitwasp/bitcoin, no need to add it in your own composer.json
https://github.com/blocktrail/blocktrail-sdk-php/blob/master/composer.json#L36
blocktrail-sdk-php also requires 99designs/http-signatures-guzzlehttp
which requires
"symfony/http-foundation": "~2.8|~3.0",
and then, you are requiring a newer http-foundation ("^4.1") in another package, specifically laravel-framework (check composer.lock)
I think your best option is to review what you actually want, review composer.json and create it again from scratch starting from the most important package.
Please start from the most important package, and match the versions to it starting from there. You'll have to review composer.json "require" node for every dependency package you need, and sometimes use some older package release (some of them are already made for symfony 4.X while some of your requirements can only handle 3.X). On github, you can easily switch to older revisions via dropdown on the top when you review composer.json to older version until the "require" matches your own dependency versions.
Please be aware you might have to prepare forks of the specific repos to make the adjustments.
If you're doing an update, remember to submit a PR with the package update, so programmers later don't have to fight the same thing :)
How can I Prevent my application from upgrading to Laravel 5.4 when I run composer update.
Thanks for any assistance.
Simply edit your project's composer.json and set exact version for laravel/laravel component you want to keep, i.e.:
"require": {
"laravel/framework": "5.3.29",
...
},
Alternatively, if you want still to have automatic updates for your current version you can use * (and this is constrain which Laravel uses too):
"require": {
"laravel/framework": "5.3.*",
...
},
See docs on how Composer versions are handled.
If unsure what version of Laravel you are using now, list it with composer:
composer show laravel/*
If you want to work on dev branch of the 5.3 version you should change dependency in your Laravel's composer.json:
"require": {
...
"laravel/framework": "5.3.*#dev",
...
},
where #dev points the development feature branch of 5.3.*.
Inside your composer.json file:
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*"
- your other packages here -
},
Make sure the "laravel/framework": "5.3.*" line is set to version 5.3.* instead of 5.4.*