HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/quadcode/app/Http/Requests/AbstractRequestFrom.php
<?php

namespace App\Http\Requests;

use App\Helpers\AppHelper;
use App\Rules\PhoneRule;
use App\Rules\ReCaptcha;
use Illuminate\Foundation\Http\FormRequest;

class AbstractRequestFrom extends FormRequest
{

    public function rules()
    {
        $rules = [
            'first_name' => ['required', 'string'],
            'email' => ['required', 'email:strict'],
            'terms_agree' => ['required'],
            'phone' => ['required', 'string', new PhoneRule()],
            'g-recaptcha-response' => ['required', new ReCaptcha()],

            'referrer' => '',
            'landing_url' => '',
            'utm_campaign' => '',
            'utm_medium' => '',
            'utm_source' => '',
            'lang' => '',
            'lang_by_browser' => '',
            'roistat_id' => '',
            'lead_magnet' => '',
        ];

        if (AppHelper::isDev()) {
            unset($rules['g-recaptcha-response']);
        }

        return $rules;
    }

    public function messages(): array
    {
        return [
            'required' => __('validation.Required'),
            'email' => __('validation.Must be a valid email'),
            'g-recaptcha-response' => __('validation.required'),
        ];
    }

    public function attributes(): array
    {
        return [
            'g-recaptcha-response' => 'Recaptcha',
        ];
    }

}