How to upgrade Laravel from 5.7 to 5.8 - laravel

I have been googling and reading on this for several days.
I am unable to update my Laravel project from 5.7 to 5.8, due to dependencies. When I update the dependency package version values in composer.json and try to perform a laravel update, it ignores my updates, and actually reverts them back to the original values.
Composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"anhskohbo/no-captcha": "^3.0",
"chriskonnertz/open-graph": "^1.0",
"cmgmyr/messenger": "^2.16",
"cviebrock/eloquent-sluggable": "^4.6",
"doctrine/dbal": "^2.8",
"egeloen/http-adapter": "^1.0",
"eilander/gateway": "^5.6",
"exodusanto/administrator": " 5.7.*",
"fideloper/proxy": "^4.0",
"fzaninotto/faker": "^1.8",
"geocoder-php/bing-maps-provider": "^4.0",
"geocoder-php/chain-provider": "^4.0",
"geocoder-php/google-maps-provider": "^4.2",
"geoip2/geoip2": "^2.9",
"hemp/presenter": "^1.0",
"hieu-le/active": "^3.5",
"htmlmin/htmlmin": "^5.8",
"intervention/image": "^2.4",
"laravel/framework": "5.7.*",
"laravel/passport": "^7.0",
"laravel/socialite": "^4.1",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.7",
"league/period": "4.1.0",
"maatwebsite/excel": "^3.1",
"morrislaptop/laravel-queue-clear": "^1.1",
"php-http/guzzle6-adapter": "^1.1",
"php-http/message": "^1.7",
"phpoffice/phpspreadsheet": "^1.5",
"pragmarx/firewall": "^2.2",
"predis/predis": "^1.1",
"prettus/l5-repository": "^2.6",
"prettus/laravel-validation": "^1.1",
"ryanwinchester/hubspot-php": "~1.0",
"sammyk/laravel-facebook-sdk": "^3.5",
"santigarcor/laratrust": "^5.0",
"spatie/laravel-newsletter": "^4.2",
"toin0u/geocoder-laravel": "^4.0",
"torann/geoip": "^1.0",
"venturecraft/revisionable": "^1.28",
"watson/sitemap": "^2.0",
"yajra/laravel-datatables-oracle": "^8.9"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.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
},
"minimum-stability": "dev",
"prefer-stable": true
}
Steps I take:
1) Edit my composer.json file, changing: "laravel/framework": "5.7."
to: "laravel/framework": "5.8."
2) Run composer update
Output:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: anhskohbo/no-captcha
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: chriskonnertz/open-graph
Discovered Package: cmgmyr/messenger
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: exodusanto/administrator
Discovered Package: fideloper/proxy
Discovered Package: hemp/presenter
Discovered Package: hieu-le/active
Discovered Package: htmlmin/htmlmin
Discovered Package: intervention/image
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/passport
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: maatwebsite/excel
Discovered Package: morrislaptop/laravel-queue-clear
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: pragmarx/firewall
Discovered Package: prettus/l5-repository
Discovered Package: sammyk/laravel-facebook-sdk
Discovered Package: santigarcor/laratrust
Discovered Package: spatie/laravel-newsletter
Discovered Package: toin0u/geocoder-laravel
Discovered Package: torann/geoip
Discovered Package: watson/sitemap
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.
Result:
composer.json file has been reset to show : "laravel/framework": "5.7.*"
Things I've tried:
1) Deleting the composer.lock file prior to attempting this.
2) Performing a php artisan cache:clear prior to my updates.
There has to be someone out there who has experienced these issues that can help me out.

Just follow the Official Upgrade Guide:
Update your composer.json laravel/framework to 5.8.*
Run composer update. There's no need to deleting `composer.lock
Check the upgrade guide above for changes that might affect uour application. This version have almost no breaking changes.

Turns out the IDE (Eclipse Neon) was never updating my composer.json file even though it indicated I was. I edited it from the command line, and it worked.

My personal experiences in this sort of situations has learned me to create a brand new project with new version of Laravel and then add my personal changes (i.e. controllers, models, migrations, views, configurations, etc.). Of course using unit tests will help you a lot to successfully upgrade your project to the next level.
BTW. this link may help you to upgrade safely but again, I highly recommend to use a brand new installation instead of dealing with a mess of changes.

Related

Jetstream Installation Failed: could not be resolved to an installable set of packages

I'm getting this error while installing Laravel Jetstream:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/jetstream[v2.3.0, ..., 2.x-dev] require league/commonmark ^1.3 -> found league/commonmark[1.3.0, ..., 1.6.x-dev] but the package is fixed to 2.0.0 (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.
- Root composer.json requires laravel/jetstream ^2.3 -> satisfiable by laravel/jetstream[v2.3.0, ..., 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.
it's a fresh installed Laravel Framework 8.51.0
I try these answers but it does not work for me, so I try this one.
first, should install Jetstream in a new Laravel application (read this doc from Jetstream laravel :https://jetstream.laravel.com/2.x/installation.html).
first step:
install new laravel project version 8
composer require laravel/jetstream:*
and it's done
continue the installation for the jetstream
The Laravel 8 docs not clear. You can fix it by following commands:
php artisan jetstream:install livewire
npm install && npm run dev
Reference:
https://github.com/laravel/jetstream#installation
https://laracasts.com/discuss/channels/inertia/laravel-8-jetstream-livewire-inertia-error
This command:
composer require laravel/jetstream
also generated the same errors as you for me, but this other command works fine:
composer require laravel/jetstream:*
I try to install fresh laravel (specific laravel project like this):
composer create-project --prefer-dist laravel/laravel:^8.0 olshop-larafel
then inside into this project
cd olshop-larafel
And install laravel/jetstream:
composer require laravel/jetstream
All works fine. Have you tried to install laravel 8.0 specific version?
Or maybe this article will help you
Information, this is my composer.json file:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.0",
"laravel/jetstream": "^2.3",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"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"
]
}
}

I got error installing guzzlehttp/guzzle in in laravel 5.8 app

I need to install guzzlehttp/guzzle to work with stripe in laravel 5.8 app but I got
error with installing :
$ composer require guzzlehttp/guzzle
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Using version ^7.2 for guzzlehttp/guzzle
./composer.json has been updated
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for php-http/guzzle6-adapter (locked at v1.1.1, required as ^1.0) -> satisfiable by php-http/guzzle6-adapter[v1.1.1].
- Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev].
- Can only install one of: guzzlehttp/guzzle[7.3.x-dev, 6.5.x-dev].
- Conclusion: install guzzlehttp/guzzle 6.5.x-dev
- Installation request for guzzlehttp/guzzle ^7.2 -> satisfiable by guzzlehttp/guzzle[7.2.0, 7.3.x-dev].
My composer.json has :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"clarification/sendgrid-laravel-driver": "^2.0",
"darkaonline/l5-swagger": "5.8.*",
"fideloper/proxy": "^4.0",
"jenssegers/agent": "^2.6",
"laravel/framework": "5.8.38",
"laravel/tinker": "^1.0",
"martinlindhe/laravel-vue-i18n-generator": "^0.1.46",
"paragonie/sodium_compat": "^1.14",
"php-http/guzzle6-adapter": "^1.0",
"guzzlehttp/guzzle": "^5.x",
"pusher/pusher-php-server": "^4.1.1",
"stripe/stripe-php": "^7.50",
"tintnaingwin/email-checker": "^2.0",
"spatie/browsershot": "^3.37",
"twilio/sdk": "^5.42"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"files": [
"app/library/helper.php"
],
"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"
]
}
}
I use PHP 7.4.15 .
How can it be fixed ?
Thanks!
You have to update the version of your guzzlehttp/guzzle becasue it is required by php version
Try to Change "guzzlehttp/guzzle": "^5.x" to this "guzzlehttp/guzzle": "^7.2.0" and then run composer update and your current php version is ^7.2
you can find more about it in here https://packagist.org/packages/guzzlehttp/guzzle#6.5.5
There is a conflict with the lastest version, use this instead
composer require guzzlehttp/guzzle:^7.0

Laravel Composer error while install sanctum: conflict with contracts

I get this error while installing laravel sanctum by composer
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/sanctum[v2.9.0, ..., 2.x-dev] require illuminate/contracts ^6.9|^7.0|^8.0 -> found illuminate/contracts[v6.10.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.
- Root composer.json requires laravel/sanctum ^2.9 -> satisfiable by laravel/sanctum[v2.9.0, ..., 2.x-dev].
I tried to install laravel contracts by
composer require illuminate/contracts
but get this error
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires illuminate/contracts ^8.36, found illuminate/contracts[v8.36.0, v8.36.1, v8.36.2, 8.x-dev] but these were not loaded, likely because it conflicts with
another require.
Composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"darkaonline/l5-swagger": "5.8.*",
"fideloper/proxy": "^4.0",
"fruitcake/laravel-cors": "^2.0",
"iatstuti/laravel-cascade-soft-deletes": "1.0.*",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.2.0",
"morilog/jalali": "3.*",
"niklasravnsborg/laravel-pdf": "^3.1",
"nwidart/laravel-modules": "^5.1",
"predis/predis": "^1.1",
"shetabit/payment": "^2.1",
"ext-json": "*"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/"
},
"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"
]
}
}
laravel/framework is pinned to v5.8 and laravel/sanctum is not compatible with that. It needs at least Laravel v6
You are using laravel version "laravel/framework": "5.8.*" which does not support laravel/sanctum
Try to upgrade your project to at-least laravel/framework": "7.0.* by following the guide enter link description here
Then Run $composer update
You Need to compatible version of 'illuminate/contracts' and Apparently this package is exist in your project.
check 'composer.json' file and fix 'illuminate/contracts' fits 'laravel/sanctum' and laravel version.

Testing pull requests

I recently discovered a vulnerability in a package that I like to use in my Laravel projects. The package is a log viewer for Laravel: https://github.com/ARCANEDEV/LogViewer.
I put in an issue about the vulnerability and the owner said I can put in a Pull Request to try and rectify the issue, and I feel I could at least try.
My question is: is there a way to use the version of the package with my Pull Request in a testing environment, as if I were installing it via Composer?
Essentially, away from actual unit tests, is there a way to test run a package in a project?
Updates given research and available answers
After much Googling and reading of answers I tried the following:
Fork the repo I'm looking to make a pull request for. The fork is here: https://github.com/blorange2/LogViewer
Clone this forked repo onto my local machine and switch to the branch that's compatible with my current version of Laravel (which is v4.5 for Laravel 5.6)
Update the composer.json in my local project to have a repositories array
"repositories": [
{
"type": "path",
"url": "../forks/LogViewer"
}
],
With the whole thing looking like this:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"repositories": [
{
"type": "path",
"url": "../forks/LogViewer"
}
],
"require": {
"php": "^7.1.3",
"alexusmai/laravel-purifier": "^0.5.0",
"arcanedev/log-viewer": "^4.5",
"artesaos/laravel-linkedin": "^1.3",
"barryvdh/laravel-dompdf": "^0.8.4",
"cartalyst/tags": "6.0.*",
"cornford/googlmapper": "^2.33",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"guzzlehttp/psr7": "^1.4",
"happyr/linkedin-api-client": "^1.0",
"intervention/image": "^2.5",
"ixudra/curl": "^6.16",
"jdavidbakr/mail-tracker": "~2.1",
"laravel/framework": "5.6.*",
"laravel/scout": "^5.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.6",
"laravolt/avatar": "^3.0",
"league/flysystem-sftp": "~1.0",
"maatwebsite/excel": "^3.1",
"maddhatter/laravel-fullcalendar": "^1.3",
"mews/purifier": "^2.1",
"php-http/curl-client": "^1.7",
"php-http/message": "^1.6",
"pusher/pusher-http-laravel": "^4.2",
"socialiteproviders/microsoft-graph": "^2.0",
"spatie/calendar-links": "^1.0",
"spatie/flysystem-dropbox": "^1.2",
"spatie/laravel-analytics": "^3.6",
"spatie/laravel-backup": "^5.9",
"spatie/laravel-medialibrary": "7.6.3",
"spatie/laravel-permission": "^2.12",
"teamtnt/laravel-scout-tntsearch-driver": "^3.0",
"thujohn/twitter": "^2.2",
"unisharp/laravel-filemanager": "~1.8",
"vimeo/laravel": "^5.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"files": [
"app/Helpers/Helper.php"
],
"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
},
"minimum-stability": "dev",
"prefer-stable": true
}
My main project is located at the following path (from running pwd on Windows) C:\xampp\htdocs\projects\newable\newable-intranet
The cloned, forked project is located here: C:\xampp\htdocs\projects\forks\LogViewer.
However, running composer update does not use the local version, it just uses: "arcanedev/log-viewer": "^4.5",
When you want to use a custom version of a library in your project like with the original package, you can modify the composer.json.
You can add custom package sources (aka repositories) to your composer.json for local development I prefer the path-repository:
{
"repositories": [
{
"type": "path",
"url": "../LogViewer"
}
],
"require": {
"arcanedev/log-viewer": "*",
...
},
...
}
So if your project and LogView-library are in the same workspace directory, side by side, this will jump up to that workspace-directory and go into the library folder. In there it will look for a composer.json. You should then be able to update to your custom library, e.g. using composer require arcanedev/log-viewer:"*" or by manually changing the entry as shown above and then runcomposer install`.
Making composer download the custom version can be a bit tricky from time to time, but in general this should work. If it won't "download" your version, i.e. symlink the local folder, try removing the existing vendor folder and running composer install again. You can also add debug output to composer install -vvv to see if the repository is found and used.
The less elaborate approach would be to remove the original library folder inside your project's vendor/ folder and instead place a symlink to your custom library manually. This is usually enough when all you do is a small bugfix inside the library's code, but when you change dependencies and version requirements I prefer the first approach as it basically simulates downloading the package through composer making sure it is properly usable in client projects.

Class 'Laravel\Passport\Passport' not found on Laravel 5.7

I just cloned a repo with a Laravel 5.7 project, and I am having some troubles to run it on my machine.
When I make a composer install, I get this error:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
In AuthServiceProvider.php line 35:
Class 'Laravel\Passport\Passport' not found
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 1
What can I do to solve this error? I dont know where to start.
This is the project's composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"designmynight/laravel-mongodb-passport": "^1.1",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"jenssegers/mongodb": "^3.4",
"laravel/framework": "5.7.*",
"laravel/passport": "^7.0",
"laravel/tinker": "^1.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"
},
"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
},
"minimum-stability": "dev",
"prefer-stable": true
}
Although composer update did the trick depending on situation it might not be the best solution.
First of all - when running composer install packages are installed based on versions that are in composer.lock if it's included in repository (it should be).
And in your case when you look carefully at console output you had:
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
So it's quite possible that someone added Laravel Passport package to composer.json but haven't run composer install or forgot to commit updated composer.lock file.
Now remember when running composer update you update all the packages. Sometimes it's fine (only on localhost) but sometimes it's not because not always you want to update all packages. So when you need to update single package you could try in this case also composer update laravel/passport just to force updating/installing just Laravel Passport without touching other packages.
It looks like you need to do
composer update
instead of install?

Resources