I have currently a problem with testing a new laravel package. For a better testing environment I would like to use Orchestra's techbench. I follow the whole installation guide. At the moment my PhpStorm IDE could not find the testbench package but it is included in the vendor directory. I guess it's some autoloading problem but I can't find the mistake.
I tried to install the package with:
composer require --dev "orchestra/testbench=^3.5"
composer.json
"require-dev": {
"mockery/mockery": "^1.0#dev",
"phpunit/phpunit": "^6.2|^7.0",
"orchestra/testbench": "~3.5.0",
"orchestra/database": "~3.5.0"
}
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
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.
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.
i have in trouble in using breadcrumbs for laravel,i using laravel 5.3 and when i install the package, it always fail and display error message like in the picture
If you have solution i do hope you can share to me...
Thanks
Try to install v5.1.1
composer require davejamesmiller/laravel-breadcrumbs:5.1.1
Here are the requirements to run composer require davejamesmiller/laravel-breadcrumbs:5.1.2
"require": {
"php": ">=7.1.3",
"illuminate/support: 5.6.*",
"illuminate/view: 5.6.*,
"laravel/framework": "5.6.*"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
Add this to your composer.json. Hope it helps
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 :)