PHP 8.3.31
Preview: ValidatedInput.php Size: 4.55 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Support/ValidatedInput.php

<?php

namespace Illuminate\Support;

use ArrayIterator;
use Illuminate\Contracts\Support\ValidatedData;
use Illuminate\Support\Traits\InteractsWithData;
use Symfony\Component\VarDumper\VarDumper;
use Traversable;

class ValidatedInput implements ValidatedData
{
    use InteractsWithData;

    /**
     * The underlying input.
     *
     * @var array
     */
    protected $input;

    /**
     * Create a new validated input container.
     *
     * @param  array  $input
     * @return void
     */
    public function __construct(array $input)
    {
        $this->input = $input;
    }

    /**
     * Merge the validated input with the given array of additional data.
     *
     * @param  array  $items
     * @return static
     */
    public function merge(array $items)
    {
        return new static(array_merge($this->all(), $items));
    }

    /**
     * Get the raw, underlying input array.
     *
     * @param  array|mixed|null  $keys
     * @return array
     */
    public function all($keys = null)
    {
        if (! $keys) {
            return $this->input;
        }

        $input = [];

        foreach (is_array($keys) ? $keys : func_get_args() as $key) {
            Arr::set($input, $key, Arr::get($this->input, $key));
        }

        return $input;
    }

    /**
     * Retrieve data from the instance.
     *
     * @param  string|null  $key
     * @param  mixed  $default
     * @return mixed
     */
    protected function data($key = null, $default = null)
    {
        return $this->input($key, $default);
    }

    /**
     * Get the keys for all of the input.
     *
     * @return array
     */
    public function keys()
    {
        return array_keys($this->input());
    }

    /**
     * Retrieve an input item from the validated inputs.
     *
     * @param  string|null  $key
     * @param  mixed  $default
     * @return mixed
     */
    public function input($key = null, $default = null)
    {
        return data_get(
            $this->all(), $key, $default
        );
    }

    /**
     * Dump the validated inputs items and end the script.
     *
     * @param  mixed  ...$keys
     * @return never
     */
    public function dd(...$keys)
    {
        $this->dump(...$keys);

        exit(1);
    }

    /**
     * Dump the items.
     *
     * @param  mixed  $keys
     * @return $this
     */
    public function dump($keys = [])
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        VarDumper::dump(count($keys) > 0 ? $this->only($keys) : $this->all());

        return $this;
    }

    /**
     * Get the instance as an array.
     *
     * @return array
     */
    public function toArray()
    {
        return $this->all();
    }

    /**
     * Dynamically access input data.
     *
     * @param  string  $name
     * @return mixed
     */
    public function __get($name)
    {
        return $this->input($name);
    }

    /**
     * Dynamically set input data.
     *
     * @param  string  $name
     * @param  mixed  $value
     * @return mixed
     */
    public function __set($name, $value)
    {
        $this->input[$name] = $value;
    }

    /**
     * Determine if an input item is set.
     *
     * @return bool
     */
    public function __isset($name)
    {
        return $this->exists($name);
    }

    /**
     * Remove an input item.
     *
     * @param  string  $name
     * @return void
     */
    public function __unset($name)
    {
        unset($this->input[$name]);
    }

    /**
     * Determine if an item exists at an offset.
     *
     * @param  mixed  $key
     * @return bool
     */
    public function offsetExists($key): bool
    {
        return $this->exists($key);
    }

    /**
     * Get an item at a given offset.
     *
     * @param  mixed  $key
     * @return mixed
     */
    public function offsetGet($key): mixed
    {
        return $this->input($key);
    }

    /**
     * Set the item at a given offset.
     *
     * @param  mixed  $key
     * @param  mixed  $value
     * @return void
     */
    public function offsetSet($key, $value): void
    {
        if (is_null($key)) {
            $this->input[] = $value;
        } else {
            $this->input[$key] = $value;
        }
    }

    /**
     * Unset the item at a given offset.
     *
     * @param  string  $key
     * @return void
     */
    public function offsetUnset($key): void
    {
        unset($this->input[$key]);
    }

    /**
     * Get an iterator for the input.
     *
     * @return \ArrayIterator
     */
    public function getIterator(): Traversable
    {
        return new ArrayIterator($this->input);
    }
}

Directory Contents

Dirs: 6 × Files: 38

Name Size Perms Modified Actions
Defer DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
Facades DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
Process DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
Testing DIR
- drwxrwxrwx 2025-09-17 06:53:01
Edit Download
Traits DIR
- drwxrwxrwx 2025-09-17 06:53:02
Edit Download
995 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.94 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
898 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.98 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
6.79 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.25 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
7.76 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
3.15 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.96 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
6.27 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.34 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
12.93 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
665 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.07 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.09 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
3.47 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.05 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
5.87 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.42 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
10.03 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
5.16 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
3.35 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
10.60 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.88 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.05 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.64 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.84 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.00 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.50 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
14.67 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
11.78 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
57.38 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
34.67 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.66 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
9.68 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.95 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.55 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.59 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).