前提・実現したいこと
現在アプリケーションにてuserとadminでマルチ認証をしています
会員登録時にメール認証を行うようにしたくuser側はMustverifyemailをimplementsして
通常通りに動作しているのですが、admin側の認証がうまく行きません
admin側で登録を行うとuserではメール送信しましたというようなページへ遷移しますが
admin側はそのまま指定したリダイレクトのページへ遷移してしまいます。
ただ、本登録用のメールは届いており、クリックしてみてもemail_verified_atカラムはからのままで
認証はされません。
admin側はimplements MustVerifyEmailとしたのみですが、それだけではダメなのでしょうか?
Admin.php
php
1<?php 2 3namespace App; 4 5use Illuminate\Contracts\Auth\MustVerifyEmail; 6use Illuminate\Foundation\Auth\User as Authenticatable; 7use Illuminate\Notifications\Notifiable; 8use App\Notifications\VerifyEmailJapanese; 9 10class Admin extends Authenticatable implements MustVerifyEmail 11{ 12 use Notifiable; 13 14 /** 15 * The attributes that are mass assignable. 16 * 17 * @var array 18 */ 19 protected $fillable = [ 20 'name', 'email', 'password','postNumber','area','tell','img' 21 ]; 22 23 /** 24 * The attributes that should be hidden for arrays. 25 * 26 * @var array 27 */ 28 protected $hidden = [ 29 'password', 'remember_token', 30 ]; 31 32 /** 33 * The attributes that should be cast to native types. 34 * 35 * @var array 36 */ 37 protected $casts = [ 38 'email_verified_at' => 'datetime', 39 ]; 40 41 public function sendEmailVerificationNotification() 42 { 43 $this->notify(new VerifyEmailJapanese); 44 } 45}
補足情報(FW/ツールのバージョンなど)
laravel 6.0.3
あなたの回答
tips
プレビュー