Файловый менеджер - Редактировать - /home/clickysoft/public_html/somni.clickysoft.net/app/Http/Controllers/VerifyEmailController.php
Назад
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests\Front\VerificationEmailRequest; use App\Repositories\UserRepository; use App\Interfaces\UserRepositoryInterface; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\Events\Verified; use Laravel\Fortify\Contracts\VerifyEmailResponse; class VerifyEmailController extends Controller { private UserRepositoryInterface $userInterfaceObj; //User Interface Object public function __construct(UserRepository $userRepo){//Constructor $this->userInterfaceObj = $userRepo; } public function verify(Request $request) { $user = $this->userInterfaceObj->getUserByKey('id',$request->route('id')); if (!hash_equals((string) $request->route('hash'), sha1($user->getEmailForVerification()))) { throw new AuthorizationException; } if ($user->markEmailAsVerified()) event(new Verified($user)); $user->update(['is_active' => 1]); return redirect()->route('web.login')->with('success','Email Verified Please Login'); } public function emailVerificationShow(){ return view('front.emailVerify'); } public function sendEmailVerification(VerificationEmailRequest $request){ try { $user = $this->userInterfaceObj->getUserByKey('email',$request->email); if(!$user){ return back()->with('error','No User Found with this email'); } if($user->email_verified_at != null){ return back()->with('error','User Already Verified'); } $user->sendEmailVerificationNotification(); return back()->with('success','Verification email sent. Make sure to check your spam folder.')->with('email',$request->email); } catch (\Throwable $th) { throw $th; } } public function resendVerificationEmail(VerificationEmailRequest $request){ try { $user = $this->userInterfaceObj->getUserByKey('email',$request->email); if(!$user){ return back()->with('error','No User Found with this email'); } if($user->email_verified_at != null){ return back()->with('error','User Already Verified'); } $user->sendEmailVerificationNotification(); return back()->with('success', 'Verification link sent!')->with('email',$request->email); } catch (\Throwable $th) { throw $th; } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка