Laravel6での開発を始めております。
マルチユーザーで、メール認証を各ユーザーにさせているのですが、メールは飛び、URLに飛ぶと、エラーが出てしまいます。
Laravel6の情報がWeb上に少なく、ご教授いただければ幸いです。
エラー内容
BadMethodCallException Method Illuminate\Http\Request::markEmailAsVerified does not exist.
User\Auth\VerificationController.php
php
1<?php 2 3namespace App\Http\Controllers\User\Auth; 4 5 6use App\Http\Controllers\Controller; 7use App\Providers\RouteServiceProvider; 8use Illuminate\Foundation\Auth\VerifiesEmails; 9use Illuminate\Http\Request; 10use Illuminate\Auth\Events\Verified; 11 12 13use Illuminate\Auth\Access\AuthorizationException; 14 15class VerificationController extends Controller 16{ 17 /* 18 |-------------------------------------------------------------------------- 19 | Email Verification Controller 20 |-------------------------------------------------------------------------- 21 | 22 | This controller is responsible for handling email verification for any 23 | user that recently registered with the application. Emails may also 24 | be re-sent if the user didn't receive the original email message. 25 | 26 */ 27 28 use VerifiesEmails; 29 30 /** 31 * Where to redirect users after verification. 32 * 33 * @var string 34 */ 35 protected $redirectTo = '/user/'; 36 37 /** 38 * Create a new controller instance. 39 * 40 * @return void 41 */ 42 43 44 public function __construct() 45 { 46 $this->middleware('verified'); 47 $this->middleware('signed')->only('verify'); 48 $this->middleware('throttle:6,1')->only('verify', 'resend'); 49 50 51 52 } 53 54 public function show(Request $request) 55 { 56 57 return $request->user()->hasVerifiedEmail() 58 ? redirect($this->redirectPath()) 59 : view('user.verify'); 60 } 61 public function verify(Request $request) 62 { 63 if ($request->route('id') != $request->getKey()) { 64 throw new AuthorizationException; 65 } 66 67 if ($request->markEmailAsVerified()) { 68 event(new Verified($request->user())); 69 } 70 71 return redirect($this->redirectPath())->with('user.verified', true); 72 } 73 74 public function resend(Request $request) 75 { 76 if ($request->user()->hasVerifiedEmail()) { 77 return redirect($this->redirectPath()); 78 } 79 80 $request->user()->sendEmailVerificationNotification(); 81 82 return back()->with('user.resent', true); 83 } 84}