Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar

Updating laravel/passport package in laravel

I am in the middle of updating my Laravel framework from version 10 to version 11:

Everything went well, except when trying to update laravel/passport version:

	D:\xampp82\htdocs\zws_admin_11>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
		- league/oauth2-server 9.2.0 requires lcobucci/jwt ^5.0 -> satisfiable by lcobucci/jwt[5.0.0, ..., 5.5.0].
		- laravel/passport[v12.0.0, ..., v12.4.2] require lcobucci/jwt ^4.3|^5.0 -> satisfiable by lcobucci/jwt[4.3.0, 5.0.0, ..., 5.5.0].
		- laravel/passport[v0.1.0, ..., v0.2.4, v1.0.0, ..., v1.0.18, v2.0.0, ..., v2.0.11, v3.0.0, ..., v3.0.2, v4.0.0, ..., v4.0.3, v5.0.0, ..., v5.0.3, v6.0.0, ..., v6.0.7, v7.0.0, ..., v7.5.1] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.8] but it conflicts with your root composer.json require (^7.9).
- laravel/passport[v8.0.0, ..., v8.5.0, v9.0.0, ..., v9.3.2] require php ^7.2 -> your php version (8.2.12) does not satisfy that requirement.
- laravel/passport v9.4.0 requires illuminate/auth ^6.18.31|^7.22.4 -> found illuminate/auth[v6.18.31, ..., v6.20.44, v7.22.4, ..., v7.30.6] but these were not loaded, likely because it conflicts with another require.
- laravel/passport[v10.0.0, ..., v10.0.1] require php ^7.3 -> your php version (8.2.12) does not satisfy that requirement.
- laravel/passport[v10.1.0, ..., v10.2.2] require illuminate/auth ^8.2 -> found illuminate/auth[v8.2.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- laravel/passport[v10.3.0, ..., v10.3.2] require illuminate/auth ^8.2|^9.0 -> found illuminate/auth[v8.2.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- laravel/passport[v10.3.3, ..., v10.4.2] require illuminate/auth ^8.37|^9.0 -> found illuminate/auth[v8.37.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- laravel/passport[v11.0.0, ..., v11.4.0] require illuminate/auth ^9.0 -> found illuminate/auth[v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- laravel/passport[v11.5.0, ..., v11.10.6] require illuminate/auth ^9.0|^10.0 -> found illuminate/auth[v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.28] but these were not loaded, likely because it conflicts with another require.
- lcobucci/jwt[4.3.0, 5.0.0, ..., 5.5.0] require ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
- laravel/passport[v13.0.0, ..., v13.0.1] require league/oauth2-server ^9.2 -> satisfiable by league/oauth2-server[9.2.0].
- Root composer.json requires laravel/passport * -> satisfiable by laravel/passport[v0.1.0, ..., v0.2.4, v1.0.0, ..., v1.0.18, v2.0.0, ..., v2.0.11, v3.0.0, v3.0.1, v3.0.2, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v5.0.0, v5.0.1, v5.0.2, v5.0.3, v6.0.0, ..., v6.0.7, v7.0.0, ..., v7.5.1, v8.0.0, ..., v8.5.0, v9.0.0, ..., v9.4.0, v10.0.0, ..., v10.4.2, v11.0.0, ..., v11.10.6, v12.0.0, ..., v12.4.2, v13.0.0, v13.0.1].

			To enable extensions, verify that they are enabled in your .ini files:
			 - D:\xampp82\php\php.ini
			You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
						Alternatively, you can run Composer with `--ignore-platform-req=ext-sodium` to temporarily ignore these required extensions.

			Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
				You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/passport:*" to figure out if any version is installable, or "composer require laravel/passport:^2.1" if you know which you need.

			Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Any idea how to fix the error?

Laravel/passport is it a requirement? What could be wrong if I skip laravel/passport package installation?

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

Here's how to resolve your issue and some clarifications regarding laravel/passport:


1. Why the Error Occurs

The main error is:

lcobucci/jwt[4.3.0, 5.0.0, ..., 5.5.0] require ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.

This means the PHP Sodium extension is not enabled. laravel/passport (and its dependencies) require this extension.


2. How to Fix

A. Enable the Sodium Extension

  1. Edit your php.ini file (likely at D:\xampp82\php\php.ini).

  2. Find the following line:

    ;extension=sodium
    
  3. Remove the semicolon to enable it:

    extension=sodium
    
  4. Restart Apache (or your web server).

  5. Verify it's enabled:

    php -m | findstr sodium
    

    You should see sodium in the output.

B. Retry the Installation

Now run:

composer require laravel/passport

If you still get dependency errors, try:

composer require laravel/passport -W

The -W flag allows Composer to update other dependencies as needed.


3. Is laravel/passport Required?

  • No, Passport is not required for all Laravel apps.
  • Only install it if you need OAuth2 authentication (API authentication with access tokens).
  • If you don't use Passport, you can use Laravel's built-in authentication (sanctum for simple API tokens, or session-based for web).

4. What if You Skip Passport?

  • If your app does not use Passport for authentication, you can safely remove it from composer.json.
  • If your app does use Passport, you must resolve the extension and dependency issues.

5. Summary

  • Enable the sodium extension in PHP.
  • Retry the Composer command.
  • Only install Passport if you need OAuth2 API authentication.

Example: Enabling sodium in php.ini

; Find and uncomment this line:
extension=sodium

Example: Composer command

composer require laravel/passport -W

Let me know if you need help with any specific step!

Please or to participate in this conversation.