Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php
Строк: 47
<?php

namespace IlluminateFoundationAuth;

use 
IlluminateAuthEventsVerified;
use 
IlluminateFoundationHttpFormRequest;
use 
IlluminateValidationValidator;

class 
EmailVerificationRequest extends FormRequest
{
    
/**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    
public function authorize()
    {
        if (! 
hash_equals((string) $this->user()->getKey(), (string) $this->route('id'))) {
            return 
false;
        }

        if (! 
hash_equals(sha1($this->user()->getEmailForVerification()), (string) $this->route('hash'))) {
            return 
false;
        }

        return 
true;
    }

    
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    
public function rules()
    {
        return [
            
//
        
];
    }

    
/**
     * Fulfill the email verification request.
     *
     * @return void
     */
    
public function fulfill()
    {
        if (! 
$this->user()->hasVerifiedEmail()) {
            
$this->user()->markEmailAsVerified();

            
event(new Verified($this->user()));
        }
    }

    
/**
     * Configure the validator instance.
     *
     * @param  IlluminateValidationValidator  $validator
     * @return IlluminateValidationValidator
     */
    
public function withValidator(Validator $validator)
    {
        return 
$validator;
    }
}
Онлайн: 1
Реклама