When you run composer require laravel/passport in a Laravel 10 project, the dependency resolver often throws a cascade of errors preventing installation. The root cause is rarely a single missing package; it is usually a mismatch between the major version of the Passport library and the underlying ecosystem components like Guzzle, PHP versions, and OAuth2 server implementations.
The error log indicates that your project currently uses illuminate/auth ^9.0 (implied by Laravel 10.15.0) but requires laravel/passport. The resolver lists several blockers. First, newer versions of Passport (v11.x) depend on league/oauth2-server v8.2+, which in turn requires lcobucci/jwt ^4.3|^5.0. While your PHP version satisfies the basic runtime requirements, the specific constraint on the JWT library creates a dependency tree that Composer struggles to satisfy alongside existing locks.
More critically, the error log explicitly states: laravel/passport[v0.1.0...v7.5.1] require guzzlehttp/guzzle ~6.0 and notes a conflict with your root composer.json requirement of ^7.2. This is the most common stumbling block for developers upgrading from older Laravel versions or migrating codebases. The legacy versions of Passport are tightly coupled to Guzzle 6, while modern Laravel 8+ applications mandate Guzzle 7. Attempting to mix these results in an immediate failure because Composer cannot downgrade your core framework's Guzzle requirement to satisfy an outdated Passport version without breaking your application.
Furthermore, the error highlights a PHP extension issue: lcobucci/jwt[4.3.0, 5.0.0] require ext-sodium *. Even if you force the installation using flags like --ignore-platform-req=ext-sodium, you are masking a critical runtime dependency. The Sodium extension is required for the JWT library to handle certain cryptographic operations. Without enabling ext-sodium in your .ini files or ensuring it is loaded in CLI mode, the application will fail at runtime with cryptic errors after the initial installation appears successful.
To resolve this cleanly without relying on ignore flags, you must align the Passport version with your Laravel framework version. For a Laravel 10 project (which uses illuminate/auth ^9.0), you should target laravel/passport v10.x. The error log confirms that versions between v10.3.3 and v10.4.2 are compatible with illuminate/auth ^8.37|^9.0.
Run the following command to install a specific major version that matches your framework:
composer require laravel/passport:^10.5 --with-all-dependencies
The --with-all-dependencies flag ensures that Composer updates or downgrades associated packages like league/oauth2-server and guzzlehttp/guzzle to versions compatible with Passport 10, rather than trying to force the outdated Guzzle 6 into your Guzzle 7 environment.
Once installed, you must manually publish the migration files and configuration keys:
php artisan package:discover --ansi
php artisan passport:install
Be aware that installing Passport introduces a new authentication provider alongside Sanctum. In many API projects, developers rely solely on Sanctum for stateless token authentication. Adding Passport creates redundancy unless you have a specific need for OAuth2 scopes or socialite-like authorization flows. If your application is strictly an API using Sanctum tokens, consider whether Passport adds necessary value or if it introduces unnecessary complexity and maintenance overhead.
Finally, ensure ext-sodium is enabled in your PHP configuration. Check your .ini file or run php -m to verify the extension is loaded. Ignoring this requirement leads to runtime failures when the JWT library attempts cryptographic operations that the Sodium extension handles specifically.