EscolaLMS/Auth

View on GitHub
src/Http/Requests/ResendVerificationEmailRequest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace EscolaLms\Auth\Http\Requests;

use EscolaLms\Auth\EscolaLmsAuthServiceProvider;
use Illuminate\Support\Facades\Config;
use Illuminate\Validation\Rule;

class ResendVerificationEmailRequest extends ExtendableRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'email' => ['required', 'string', 'email'],
            'return_url' => ['nullable', 'url', Rule::requiredIf(fn () => !Config::get(EscolaLmsAuthServiceProvider::CONFIG_KEY . '.return_url'))],
        ];
    }
}