composer require laravel/passport not working in laravel 5.8

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company
Title: Troubleshooting Composer Require Laravel/Passport in Laravel 5.8 - A Comprehensive Guide Body:

Laravel is a popular PHP framework with robust features that make building web applications much more efficient and enjoyable. However, sometimes issues can arise when attempting to install certain packages using the Composer command line tool. One common problem encountered by Laravel 5.8 users when using composer require laravel/passport is an error message as shown in your original post. In this article, we will address this issue and provide a detailed solution.

Analysis of the Error Message

The error message you received indicates that there is conflict between different versions of packages required for the Laravel/Passport installation. To understand the issue more clearly, let's break down your specific problem:

1. Your Laravel framework version is 5.8.35, which conflicts with the minimum requirements for Laravel Passport package (version 6.0.0). 2. A dependency conflict prevents Laravel Passport from being installed - according to the message, your installation needs to remove laravel/framework v5.8.35. However, since you're following a tutorial that uses this specific version, removing it would compromise your application functionality.

Solution: Upgrade Your Laravel Version and Use a Compatible Laravel Passport Bundle

To fix the issue, consider upgrading to a compatible Laravel version and installing a tailored Laravel Passport bundle. Following these steps will ensure that your application works as intended:

1. Upgrade your Laravel framework to a minimum version required for Laravel Passport (currently 6.0.3). Note that upgrading may require adjustments in your current codebase, but the benefits are worth it. 2. Install the latest version of Laravel/Passport using Composer: `composer require laravel/passport` or specify a specific version if needed (e.g., `composer require laravel/passport:^8.0`). 3. For further guidance, refer to the official Laravel documentation on Passport installation and setup: https://laravel.com/docs/8.x/passport/installation#installing-the-package

Alternative Solution: Downgrade your Laravel Version

In case you're unable to or unwilling to upgrade your Laravel version and need a workaround, you can downgrade the laravel/framework package. This approach is not recommended due to possible security risks and compatibility issues, but if it's essential in your specific situation, follow these steps:

1. To install an older version of laravel/passport, use the same command `composer require laravel/passport` but without specifying a version or targeting the latest package. This should let Composer choose a compatible version from the past releases. 2. Downgrade your Laravel framework by editing the composer.json file manually to change the required Laravel/Framework version to 5.8.34 (or earlier) and run `composer update`. Since this could lead to conflicts with other dependencies, be prepared to adjust any affected files or packages as needed.

Final Thoughts

It's crucial to keep your application up to date and maintain compatibility between its components for optimal performance and security. Ensure you follow the Laravel documentation and check for relevant package updates regularly. By doing so, you can prevent issues like these in the future. If you find yourself facing similar problems, refer back to this comprehensive guide for a solution that fits your particular scenario.