ok

Mini Shell

Direktori : /home2/selectio/www/myclassicfit.com/vendor/laravel/passport/src/Http/Rules/
Upload File :
Current File : /home2/selectio/www/myclassicfit.com/vendor/laravel/passport/src/Http/Rules/RedirectRule.php

<?php

namespace Laravel\Passport\Http\Rules;

use Illuminate\Contracts\Validation\Factory;
use Illuminate\Contracts\Validation\Rule;

class RedirectRule implements Rule
{
    /**
     * The validator instance.
     *
     * @var \Illuminate\Contracts\Validation\Factory
     */
    protected $validator;

    /**
     * Create a new rule instance.
     *
     * @param  \Illuminate\Contracts\Validation\Factory  $validator
     * @return void
     */
    public function __construct(Factory $validator)
    {
        $this->validator = $validator;
    }

    /**
     * {@inheritdoc}
     */
    public function passes($attribute, $value)
    {
        foreach (explode(',', $value) as $redirect) {
            $validator = $this->validator->make(['redirect' => $redirect], ['redirect' => new UriRule]);

            if ($validator->fails()) {
                return false;
            }
        }

        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function message()
    {
        return 'One or more redirects have an invalid URI format.';
    }
}

Zerion Mini Shell 1.0