Как мы можем отправить соответствующую ссылку для подтверждения электронной почты admin, vendor и user auth в laravel, как admin: admin.verification.email (http://139.59.75.219/welwel/public/admin/email/verify/1?expires=1552402747&signature=b3768d97b4d98bb226171e880a95802e68540aae9f5f21f78a9782fce895c960)
vendor: vendor.verification.email (http://139.59.75.219/welwel/public/vendor/email/verify/1?expires=1552402747&signature=b3768d97b4d98bb226171e880a95802e68540aae9f5f21f78a9782fce895c960)
У пользователя уже есть valid.email (http://139.59.75.219/welwel/public/email/verify/1?expires=1552402747&signature=b3768d97b4d98bb226171e880a95802e68540aae9f5f21f78a9782fce895c960)
Даже у меня есть: Vendor \ Auth \ VerificationController.php
<?php
namespace App\Http\Controllers\Vendor\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
use Illuminate\Http\Request;
class VerificationController extends Controller{
use VerifiesEmails;
public function __construct()
{
$this->middleware('vendor');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
public function verify(Request $request)
{
if ($request->route('id') != $request->user('vendor')->getKey()) {
throw new AuthorizationException;
}
if ($request->user('vendor')->markEmailAsVerified()) {
event(new Verified($request->user('vendor')));
}
return redirect($this->redirectPath())->with('verified', true);
}
public function resend(Request $request)
{
if ($request->user('vendor')->hasVerifiedEmail()) {
return redirect($this->redirectPath());
}
$request->user('vendor')->sendEmailVerificationNotification();
return back()->with('resent', true);
}
}
middleware: VendorEnsureEmailIsVerified.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Contracts\Auth\MustVerifyEmail;
class VendorEnsureEmailIsVerified
{
public function handle($request, Closure $next)
{
if (! $request->user('vendor') ||
($request->user('vendor') instanceof MustVerifyEmail &&
! $request->user('vendor')->hasVerifiedEmail())) {
return $request->expectsJson()
? abort(403, 'Your email address is not verified.')
: Redirect::route('vendor.verification.notice');
}
return $next($request);
}
}
отлично работает, только генерация ссылок только для пользователя, а не для администратора, поставщика и пользователя