Anons79 Mini Shell

Directory : /home/aplikasiposinfo/public_html/dbon.kaltimprov.go.id/app/Rules/
Upload File :
Current File : /home/aplikasiposinfo/public_html/dbon.kaltimprov.go.id/app/Rules/YoutubeLink.php

<?php

namespace App\Rules;

use Closure;
use Illuminate\Contracts\Validation\ValidationRule;

class YoutubeLink implements ValidationRule
{
    public function passes($attribute, $value)
    {
        return (bool) preg_match('/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/', $value);
    }
    public function message()
    {
        return 'The :attribute format is invalid YouTube URL.';
    }


    /**
     * Indicates whether the rule should be implicit.
     *
     * @var bool
     */
    public $implicit = true;

    /**
     * Run the validation rule.
     *
     * @param  \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString  $fail
     */
    public function validate(string $attribute, mixed $value, Closure $fail): void
    {
        //
    }
}

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]