Laravel Gmail package not working after updating to Laravel 10 and PHP 8.2

Hi everyone! I just finished updating my Laravel project from version 5 to version 10, and also upgraded PHP from 7 to 8.2. Everything seemed to go well until I tried to use the dacastro4/laravel-gmail package.

Now I’m getting this error when I run composer:

Problem 1
- dacastro4/laravel-gmail[v0.1, ..., v0.6.2, v1.0.0, ..., v1.2, v2.0, ..., v2.0.4, v3.0.0] require illuminate/auth ~5.0|~5.1|~5.2|~5.3 -> found illuminate/auth[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
- dacastro4/laravel-gmail[v3.1.0, ..., v3.2.6, v4.0, ..., v4.0.41, v5.0.0, ..., v5.1] require php ^7.2 -> your php version (8.3.8) does not satisfy that requirement.
- dacastro4/laravel-gmail[v5.1.1, ..., v5.1.21] require illuminate/auth ~5.8|^6.0|^7.0|^8.0 -> found illuminate/auth[v5.8.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.

My current composer.json has these main dependencies:

{
  "require": {
    "php": "^8.2",
    "laravel/framework": "^10.0",
    "google/apiclient": "^2.16",
    "guzzlehttp/guzzle": "^7.2",
    "laravel/sanctum": "^3.2",
    "doctrine/dbal": "^3.8"
  }
}

It looks like this Gmail package only supports older Laravel versions. Has anyone found a solution for this or know of other packages that work with Laravel 10 for Gmail integration? Thanks for any help!

Yeah, same issue here! That package’s basically dead now. I switched to symfony/mailer with Gmail SMTP - way easier than dealing with OAuth and works great on Laravel 10. Emails go out perfectly!

You’ve encountered a common issue when upgrading Laravel, particularly regarding package compatibility. The dacastro4/laravel-gmail package seems to be no longer maintained, and thus it won’t support Laravel 10. I faced a similar problem when I upgraded from Laravel 8. The best alternative I found was the google/apiclient package, which you already have included. It requires some additional effort to set up your Gmail integration, including managing OAuth2 and developing your own service classes, but it integrates nicely with Laravel 10 and PHP 8.2. The documentation from Google is very helpful. If your needs are simpler and you don’t require the full functionality of the Gmail API, consider exploring pbmedia/laravel-mail-viewer, which supports basic IMAP connections.

Hit this exact nightmare upgrading to Laravel 10 last year. That package’s basically dead now - frustrating but pretty typical for older Laravel stuff. Don’t bother forcing compatibility. I built a custom Gmail integration using Laravel’s mail system + Gmail API directly. Took maybe half a day, been bulletproof since. You’ll handle OAuth2 yourself and write some service classes, but Laravel’s mail facade works great once configured. Plus you control everything and never deal with abandoned packages again.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.