前提
Laravel 8系
'Laravelの認証機能実装のためんFortifyをインストールしましたが、表題の
'Laravel\Fortify\Features'が
Undefined type 'Laravel\Fortify\Features'.
となっております。
config.php/fortify.php
実際にFeaturesの部分は「Undefined type 'Laravel\Fortify\Features'」の警告が赤波線で出ます。
'features' => [ Features::registration(), Features::resetPasswords(), // Features::emailVerification(), Features::updateProfileInformation(), Features::updatePasswords(), Features::twoFactorAuthentication([ 'confirm' => true, 'confirmPassword' => true, // 'window' => 0, ]), ],
Fortifyインストール手順と設定
sail composer require laravel/fortify php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider" sail artisan migrate
config/app.php
/ * Application Service Providers.. */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\FortifyServiceProvider::class, ← 追加 App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, App\Providers\TelescopeServiceProvider::class,
エラー解決にむけて試したこと
sail artisan config:cache
解決せず。
次に
https://stackoverflow.com/questions/65097400/laravel-8-class-laravel-fortify-actions-auth-not-found
↑こちらの回答に記載があるように
vendor\laravel\fortify\src\Actions\AttemptToAuthenticate ファイルに
use Illuminate\Support\Facades\Auth; use App\Providers\RouteServiceProvider;
の2行を追加しましたが解決できません。
その後も調べましたが解決できずもし原因をご存知の方がいらっしゃいましたらご教示いただけないでしょうか。
よろしくお願いいたします。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。