PHP 8.3.31
Preview: ValidatesWhenResolvedTrait.php Size: 2.16 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php

<?php

namespace Illuminate\Validation;

use Illuminate\Foundation\Precognition;

/**
 * Provides default implementation of ValidatesWhenResolved contract.
 */
trait ValidatesWhenResolvedTrait
{
    /**
     * Validate the class instance.
     *
     * @return void
     */
    public function validateResolved()
    {
        $this->prepareForValidation();

        if (! $this->passesAuthorization()) {
            $this->failedAuthorization();
        }

        $instance = $this->getValidatorInstance();

        if ($this->isPrecognitive()) {
            $instance->after(Precognition::afterValidationHook($this));
        }

        if ($instance->fails()) {
            $this->failedValidation($instance);
        }

        $this->passedValidation();
    }

    /**
     * Prepare the data for validation.
     *
     * @return void
     */
    protected function prepareForValidation()
    {
        //
    }

    /**
     * Get the validator instance for the request.
     *
     * @return \Illuminate\Validation\Validator
     */
    protected function getValidatorInstance()
    {
        return $this->validator();
    }

    /**
     * Handle a passed validation attempt.
     *
     * @return void
     */
    protected function passedValidation()
    {
        //
    }

    /**
     * Handle a failed validation attempt.
     *
     * @param  \Illuminate\Validation\Validator  $validator
     * @return void
     *
     * @throws \Illuminate\Validation\ValidationException
     */
    protected function failedValidation(Validator $validator)
    {
        $exception = $validator->getException();

        throw new $exception($validator);
    }

    /**
     * Determine if the request passes the authorization check.
     *
     * @return bool
     */
    protected function passesAuthorization()
    {
        if (method_exists($this, 'authorize')) {
            return $this->authorize();
        }

        return true;
    }

    /**
     * Handle a failed authorization attempt.
     *
     * @return void
     *
     * @throws \Illuminate\Validation\UnauthorizedException
     */
    protected function failedAuthorization()
    {
        throw new UnauthorizedException;
    }
}

Directory Contents

Dirs: 2 × Files: 19

Name Size Perms Modified Actions
Concerns DIR
- drwxrwxrwx 2025-09-17 06:52:58
Edit Download
Rules DIR
- drwxrwxrwx 2025-09-17 06:52:58
Edit Download
1.93 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
1.31 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
2.43 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
3.60 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
287 B lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
8.90 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
3.81 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
1.05 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
1.28 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
2.54 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
846 B lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
6.40 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
128 B lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
2.16 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
2.86 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
3.67 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
9.66 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
2.14 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download
41.94 KB lrw-rw-rw- 2025-09-17 06:52:58
Edit Download

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