How to use Laravel fork in project? - laravel

Once upon a time I decided to contribute Laravel framework. I forked it, created new branch, wrote feature, then I wanted to test my feature, so I created an empty Laravel project, and here I got stuck.
I changed composer.json like this
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/trckster/framework"
}
],
"require": {
...
"laravel/framework": "dev-feat/show-fields-difference-for-similar-results",
...
},
...
Then I ran composer update and composer said I'm wrong
Your requirements could not be resolved to an installable set of packages.
Problem 1
- illuminate/support[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.0.19) does not satisfy that requirement.
- illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.0.19) does not satisfy that requirement.
- illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.0.19) does not satisfy that requirement.
- Root composer.json requires laravel/framework dev-feat/show-fields-difference-for-similar-results -> satisfiable by laravel/framework[dev-feat/show-fields-difference-for-similar-results].
- laravel/tinker[v2.7.0, ..., 2.x-dev] require illuminate/support ^6.0|^7.0|^8.0|^9.0 -> satisfiable by illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev].
- Only one of these can be installed: illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev], laravel/framework[dev-feat/show-fields-difference-for-similar-results]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laravel/tinker ^2.7 -> satisfiable by laravel/tinker[v2.7.0, v2.7.1, v2.7.2, 2.x-dev].
It was obvious that problem was in dependencies, but I had no idea what to do with this stuff and finally test my feature.

After a few weeks I returned to this problem and started searching information in the Internet and found useful article, there was described similar problem and way to solve it:
Now we can adjust our fork’s composer.json requirement and tell it to treat our custom branch as v2.4.5 like so.
Basically, all I needed to do is change one line in composer.json
- "laravel/framework": "dev-feat/show-fields-difference-for-similar-results",
+ "laravel/framework": "dev-feat/show-fields-difference-for-similar-results as 9.11",
And it worked, composer update downloaded forked version from my github.
Hope this self-answered question was helpful!

Related

Unable to require auth0 dependencies in laravel

I'm using laravel 9.5 version and I wish to use the Auth0 to secure my API. Once, I enter the composer require auth0/login then I get failed with this error
Problem 1
- Root composer.json requires auth0/login ^6.5 -> satisfiable by auth0/login[6.5.0, 6.x-dev].
- auth0/login[6.5.0, ..., 6.x-dev] require illuminate/support ^6.0 || ^7.0 || ^8.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with
another require.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require auth0/login:*" to figure out if any version is installable, or "composer require auth0/login:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
PS C:\xampp\htdocs\api> composer require auth0/login
Using version ^6.5 for auth0/login
./composer.json has been updated
Running composer update auth0/login
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires auth0/login ^6.5 -> satisfiable by auth0/login[6.5.0, 6.x-dev].
- auth0/login[6.5.0, ..., 6.x-dev] require illuminate/support ^6.0 || ^7.0 || ^8.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with
another require.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require auth0/login:*" to figure out if any version is installable, or "composer require auth0/login:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content

jenssegers/mongodb dependecies issues with Laravel Sail - ext-mongodb

I'm trying to setup MongoDB in a Laravel Jetstream + Sail.
What I'm doing is trying to install the following packages:
mongodb/mongodb
jenssegers/mongodb
but I get the following errors :
Problem 1
- jenssegers/mongodb[v3.8.0, ..., v3.8.2] require mongodb/mongodb ^1.6 -> satisfiable by mongodb/mongodb[1.6.0, ..., 1.9.x-dev (alias of dev-master)].
- mongodb/mongodb 1.9.x-dev is an alias of mongodb/mongodb dev-master and thus requires it to be installed too.
- mongodb/mongodb dev-master requires ext-mongodb ^1.10.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
- mongodb/mongodb[1.6.0, ..., v1.6.x-dev] require php ^5.6 || ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.7.0-beta1, ..., v1.7.x-dev] require php ^7.0 -> your php version (8.0.2) does not satisfy that requirement.
- mongodb/mongodb[1.8.0-RC1, ..., v1.8.x-dev] require ext-mongodb ^1.8.1 -> it is missing from your system. Install or enable PHP's mongodb extension.
- Root composer.json requires jenssegers/mongodb ^3.8 -> satisfiable by jenssegers/mongodb[v3.8.0, v3.8.1, v3.8.2].
like suggested in this: Why does composer complain about the ext-mongo extension?
I added to my composer.json the following
"provide" : {
"ext-mongo": "*"
},
But nothing changed, I also tried adding the package:
"soyuka/stubs-mongodb": "^1.0",
But same problems.
Thanks
Mauro
The solution was to publish Sail docker files and add:
php8.0-mongodb
in /docker/8.0/DockerFile
Building and running:
sail composer require jenssegers/mongodb

unable to install laravel dusk dashboard

i am trying to install dusk dashborad by this command:
composer require beyondcode/dusk-dashboard --dev
but unable to install
when tried to install, it gives the error for "guzzlehttp/guzzle" version.
Problem 1
- Root composer.json requires beyondcode/dusk-dashboard ^2.0 -> satisfiable by beyondcode/dusk-dashboard[2.0.0].
- beyondcode/dusk-dashboard 2.0.0 requires guzzlehttp/guzzle ^6.3 -> found guzzlehttp/guzzle[6.3.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (7.0).
Use the option --with-all-dependencies (-W) to allow upgrades,
downgrades and removals for packages currently locked to specific
versions.
tried downgrading to guzzlehttp/guzzle to ^6.3 but then it gives this error:
Problem 1
- Root composer.json requires beyondcode/dusk-dashboard ^2.0 -> satisfiable by beyondcode/dusk-dashboard[2.0.0].
- beyondcode/dusk-dashboard 2.0.0 requires illuminate/console 5.6.|5.7.|5.8.|6.|7.* -> found illuminate/console[v5.6.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
but after installing the correct version asked in the error which is ^6.3 ,it gives this error:
i also tried updating option --wtin-all-depandencies. but did not resolve.
I think the maintainer is not actively maintaining the package. The last commit was May 30, 2020, to make it compatible with Laravel 7.

Installing Laravel Backpack 4.1 into Laravel 8

I am trying to install Backpack 4.1 into Laravel 8. I ran
composer require backpack/crud:"4.1.*"
But I received the following error.
Your requirements could not be resolved to an installable set of
packages.
backpack/crud[4.1.22, ..., 4.1.x-dev] require doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ..., 2.12.x-dev] but it conflicts
with your root composer.json require (^3.0).
backpack/crud[4.1.0, ..., 4.1.21] require laravel/framework ^7.0|^6.0 -> found laravel/framework[v6.0.0, ..., 6.x-dev, v7.0.0,
..., 7.x-dev] but it conflicts with your root composer.json require
(^8.12).
Root composer.json requires backpack/crud 4.1.* -> satisfiable by backpack/crud[4.1.0, ..., 4.1.x-dev].
I have been looking around but have not found a solution yet. Versions: Laravel 8.17, PHP 7.3.24
UPDATE I have tried installing 4.2; please see below.
Root composer.json requires backpack/crud 4.2.* -> satisfiable by
backpack/crud[4.2.x-dev]. backpack/crud 4.2.x-dev requires
doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ...,
2.12.x-dev] but it conflicts with your root composer.json require (^3.0).
Pending answer removal.
It seems Backpack 4.1 now supports Laravel8

Cant install gonoware/laravel-maps

I have troubles installing gonoware/laravel-maps on Laravel version 8.
When I do "composer require gonoware/laravel-maps" in my commander I get some errors:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- gonoware/laravel-maps v1.3.0 requires illuminate/support ^5.5|^6.0|^7.0 -> found illuminate/support[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but it conflicts with another require.
- gonoware/laravel-maps v1.3.1 requires illuminate/support ^6.0|^7.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but it conflicts with another require.
- Root composer.json requires gonoware/laravel-maps ^1.3 -> satisfiable by gonoware/laravel-maps[v1.3.0, v1.3.1].
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Can someone help me please?
gonoware/laravel-maps is not compatible with Laravel 8, as written in the error message. There's already an open bug report about this. Until this is fixed, you have no possibility to install the package while also using Laravel 8.

Resources