laravel package development - develop multiple packages that depend on eachother - laravel

I am trying to setup up a development environment for my previously developed packages which depend on eachother. I could setup laravel and a packages directory in which I cloned all the packages into. But now when I add them to laravel composer.json file and run composer update I run in the following error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for tjventurini/sunshine dev-master -> satisfiable by tjventurini/sunshine[dev-master].
- tjventurini/sunshine dev-master requires tjventurini/articles ^0.1.8 -> satisfiable by tjventurini/articles[v0.1.8] but these conflict with your requirements or minimum-stability.
Problem 2
- tjventurini/articles dev-master requires tjventurini/tags ^0.0.9 -> satisfiable by tjventurini/tags[v0.0.9] but these conflict with your requirements or minimum-stability.
- tjventurini/articles dev-master requires tjventurini/tags ^0.0.9 -> satisfiable by tjventurini/tags[v0.0.9] but these conflict with your requirements or minimum-stability.
- Installation request for tjventurini/articles dev-master -> satisfiable by tjventurini/articles[dev-master].
This is how my laravel composer.json file looks like:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"minimum-stability": "dev",
"prefer-stable" : true,
"repositories": [
{
"type": "path",
"url": "packages/sunshine"
},
{
"type": "path",
"url": "packages/articles"
},
{
"type": "path",
"url": "packages/portfolio"
},
{
"type": "path",
"url": "packages/tags"
},
{
"type": "path",
"url": "packages/mini-bootstrap-theme"
},
{
"type": "path",
"url": "packages/contact"
}
],
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"tjventurini/mini-bootstrap-theme": "dev-master",
"tjventurini/tags": "dev-master",
"tjventurini/articles": "dev-master",
"tjventurini/portfolio": "dev-master",
"tjventurini/contact": "dev-master",
"tjventurini/sunshine": "dev-master"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"symfony/thanks": "^1.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
}
}
composer did manage to create symlinks in the vendor directory for the tags and mini-bootstrap-theme packages before I added the other packages.
Also I already added the minimum-stability setting already.
Thank you!

Thanks to the comment of #Norman-N I could find an Answer very quickly. As he pointed out, I had to use aliases to use dev-master as a specific version/tag.
Here is a link to the composer documentation
I changed my composer.json as shown below.
"tjventurini/articles": "dev-master as 0.1.8",
"tjventurini/contact": "dev-master as 0.0.9",
"tjventurini/mini-bootstrap-theme": "dev-master as 0.0.3",
"tjventurini/portfolio": "dev-master as 0.0.17",
"tjventurini/sunshine": "dev-master as 0.2.10",
"tjventurini/tags": "dev-master as 0.0.9"

Related

Laravel deployment to azure windows web app using GitHub gives error requires ext-fileinfo * -> it is missing from your system

I am getting the following error when I try to deploy my laravel project to azure windows web app using github.
but it is deploying fine if I use azure tool
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v7.29.0, ..., 7.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev].
- league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^7.29 -> satisfiable by laravel/framework[v7.29.0, ..., 7.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\tools\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I have tried php --ini
C:\Program Files(x86)\PHP\v7.4\php.ini Scan for additional .ini files in:
and in that file it is enabled
extension=fileinfo
also here is my composer file
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4 || ^8",
"doctrine/dbal": "^2.13",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
"predis/predis": "^1.1",
"tcg/voyager": "^1.4",
"tymon/jwt-auth": "^1.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.3",
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"platform-check": false
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"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"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
After searching for 24 hours, I have found the solution. This is related to the php set up while deployment. To setup PHP with necessary extensions you will need to update your .yml file on GitHub repository (.github/workflows folder).
Add a new line to "Setup PHP >> with" step like "extensions: fileinfo"
If you need to enable any other extension, you can add all of the extensions as comma seperated.
Example:
- name: Setup PHP
uses: shivammathur/setup-php#v2
with:
php-version: '7.4'
extensions: fileinfo, pdo_mysql
Please read this documentation: https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support

I am getting this error with laravel scout: Your requirements could not be resolved to an installable set of packages

I'm getting this error while installing Laravel Scout:
Problem 1
- laravel/scout[v9.1.0, ..., 9.x-dev] require illuminate/bus ^8.0 -> found illuminate/bus[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires laravel/scout ^9.1 -> satisfiable by laravel/scout[v9.1.0, 9.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Here is my composer.json file:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
"laravel/ui": "^2.4"
},
"require-dev": {
"facade/ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.3",
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"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"
]
}
}
In your composer you have "laravel/framework": "^7.29", wich is equivalent to >=7.29 <8.0.0 but you're requiring illuminate/bus[v8.0.0, ..., 8.x-dev] wich is part of laravel/framework >=8.0.0
So, you can't install laravel scount version >= 9.0
try installing version 8.6.1 wich is compatible with laravel 7.x with the command:
composer require "laravel/scout:^8.6.1"
You should just install ext-xml
sudo apt-get install php-xml
sudo apt-get install php-curl

I tried to run this "composer require mckenziearts/laravel-notify" in my laravel 6 project but I get this error

Problem 1
- Root composer.json requires laravel/tinker ^2.0, found laravel/tinker[v2.0.0, ..., 2.x-dev] but the package is fixed to v1.0.10 (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.
Problem 2
- mckenziearts/laravel-notify 2.x-dev requires illuminate/support ~7.0 -> found illuminate/support[v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
- mckenziearts/laravel-notify v2.1 requires illuminate/support ^7.0|^8.0 -> found illuminate/support[v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires mckenziearts/laravel-notify ^2.1 -> satisfiable by mckenziearts/laravel-notify[v2.1, 2.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
This is the composer.json file. laravel 6.
I think there's an update for me to do but I don't know where to do that.
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"laravel/ui": "^1.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"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"
]
}
}
You are using Laravel v6 and try to install mckenziearts/laravel-notify in the most recent version, which is only compatible with Laravel v7 and v8.
You should either upgrade Laravel, or install mckenziearts/laravel-notify in v1 through composer require mckenziearts/laravel-notify "^1.0"

Cannot update laravel/passport

Actually Im trying to set API for my website on Laravel. I found that I need to add CreateFreshApiToken to Kernel.php in order to use it. Well, I wish could, but it doesn't exist. Then I have found I can get it via
composer require laravel/passport
I run it and have this one
composer require laravel/passport
./composer.json has been updated
Running composer update laravel/passport
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- artogrig/laravel-make-service[1.0.0, ..., 1.0.1] require illuminate/support ~5 -> 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 artogrig/laravel-make-service ^1.0 -> satisfiable by artogrig/laravel-make-service[1.0.0, 1.0.1].
This is my comsposer.json:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"artogrig/laravel-make-service": "^1.0",
"cviebrock/eloquent-sluggable": "^7.0",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"intervention/image": "^2.5",
"laravel/framework": "^7.0",
"laravel/passport": "^4.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"tcg/voyager": "^1.4"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"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"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
I have no idea what to do with. Could someone help me, please!
Thanks!
The dependency artogrig/laravel-make-service only works with Illuminate\Support 5, for what this package does, create service classes and is unmaintained. I would simply just remove it and your dependencies would be fixed.

Package not found from vcs repo

I have forked a repo and created a branch called 3.0 that I would like to install to my project to test (not a longterm fork. I want to create a pull request after testing). I have added the following to my composer file:
"repositories": [{
"type": "vcs",
"url": "https://github.com/albertski/laravel-grid"
}],
When running composer show "albertski/laravel-grid" I get Package albertski/laravel-grid not found.
When I run composer require albertski/laravel-grid:3
.0-dev I get the following:
Could not find a matching version of package albertski/laravel-grid. Check
the package spelling, your version constraint and that the package is avail
able in a stability which matches your minimum-stability (dev).
Am I missing any steps? According to the docs that should be it. I am using Composer version 1.9.0.
This is my full composer.json file:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/browser-kit-testing": "^5.1",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0",
"laravel/ui": "^1.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/albertski/laravel-grid"
}],
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files": ["tests/utilities/functions.php"]
},
"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"
]
}
}
Edit
Just to test it out I created a branch called 3.0_albert and updated the composer.json name field to "name": "albertski/laravel-grid",. (Not a fan of doing this because I eventually want to perform a pull request)
Then ran composer require albertski/laravel-grid:3.0_albert-dev but same issue.
I was able to figure it out. Instead of calling:
composer require albertski/laravel-grid:3.0.x-dev
You call:
composer require leantony/laravel-grid:3.0.x-dev
Basically by adding:
"repositories": [{
"type": "vcs",
"url": "https://github.com/albertski/laravel-grid"
}],
You are telling composer to check your repo first for the package instead of the default one.

Resources