Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" 未在 Laravel 9 上找到
Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" not found on Laravel 9
我只想使用 Mailgun 从我的 Laravel 项目发送电子邮件,并按照官方文档中的以下步骤操作:https://laravel.com/docs/9.x/mail#mailgun-driver
composer require symfony/mailgun-mailer symfony/http-client
当我尝试发送密码重设电子邮件进行测试时,它抛出异常:
Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" not found
这是完整的堆栈跟踪:https://flareapp.io/share/oPRKqyZ7#share
我不知道,但也许是因为这个项目开始时是一个 Laravel 8 项目,我在一周前将其更新为 Laravel 9。它是否试图在 app 目录中找到 Laravel 9 附带的内容或其他内容,但我的项目没有?没看懂。
顺便说一下,如果有帮助的话;该项目将 Jetstream 与 Inertia.js 和 Vue.js 结合使用。所以 composer.json
现在看起来像这样:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^0.5.4",
"laravel/framework": "^9.2",
"laravel/jetstream": "^2.4",
"laravel/octane": "^1.0",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"sentry/sentry-laravel": "^2.11",
"symfony/http-client": "^6.0",
"symfony/mailgun-mailer": "^6.0",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
"spatie/laravel-ignition": "^1.0",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.12",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\": "app/",
"Database\Factories\": "database/factories/",
"Database\Seeders\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
来自升级指南:
要继续使用 Mailgun 传输,您的应用程序应该需要 symfony/mailgun-mailer 和 symfony/http-client Composer 包:
所以使用:
composer require symfony/mailgun-mailer symfony/http-client
这里有更多信息Upgrade to laravel 9
显然这是我在我的项目中使用的 Laravel Octane 的东西。我已经 运行 composer require symfony/mailgun-mailer symfony/http-client
和 composer auto-dump
等并在 Supervisor 上重新启动我的进程但没有任何改变。在我杀死所有进程(包括主管,它使 Laravel Octane 保持活动状态)然后重新启动它们。
我认为 Laravel Octane 无法加载更新的作曲家自动加载文件。当一切停止并重新启动时,它们运行良好。
我只想使用 Mailgun 从我的 Laravel 项目发送电子邮件,并按照官方文档中的以下步骤操作:https://laravel.com/docs/9.x/mail#mailgun-driver
composer require symfony/mailgun-mailer symfony/http-client
当我尝试发送密码重设电子邮件进行测试时,它抛出异常:
Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" not found
这是完整的堆栈跟踪:https://flareapp.io/share/oPRKqyZ7#share
我不知道,但也许是因为这个项目开始时是一个 Laravel 8 项目,我在一周前将其更新为 Laravel 9。它是否试图在 app 目录中找到 Laravel 9 附带的内容或其他内容,但我的项目没有?没看懂。
顺便说一下,如果有帮助的话;该项目将 Jetstream 与 Inertia.js 和 Vue.js 结合使用。所以 composer.json
现在看起来像这样:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^0.5.4",
"laravel/framework": "^9.2",
"laravel/jetstream": "^2.4",
"laravel/octane": "^1.0",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"sentry/sentry-laravel": "^2.11",
"symfony/http-client": "^6.0",
"symfony/mailgun-mailer": "^6.0",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
"spatie/laravel-ignition": "^1.0",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.12",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\": "app/",
"Database\Factories\": "database/factories/",
"Database\Seeders\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
来自升级指南:
要继续使用 Mailgun 传输,您的应用程序应该需要 symfony/mailgun-mailer 和 symfony/http-client Composer 包:
所以使用:
composer require symfony/mailgun-mailer symfony/http-client
这里有更多信息Upgrade to laravel 9
显然这是我在我的项目中使用的 Laravel Octane 的东西。我已经 运行 composer require symfony/mailgun-mailer symfony/http-client
和 composer auto-dump
等并在 Supervisor 上重新启动我的进程但没有任何改变。在我杀死所有进程(包括主管,它使 Laravel Octane 保持活动状态)然后重新启动它们。
我认为 Laravel Octane 无法加载更新的作曲家自动加载文件。当一切停止并重新启动时,它们运行良好。