Example of Custom validation rules in christophrumpel/larastreamers

File app/Rules/YouTubeRule.php (link to Github)
use App\Facades\Youtube;
use App\Services\Youtube\YoutubeException;
use Illuminate\Contracts\Validation\Rule;

class YouTubeRule implements Rule
{
    public function passes($attribute, $value): bool
    {
        try {
            $video = Youtube::video($value);
        } catch (YoutubeException) {
            $this->message = 'This is not a valid YouTube video id.';

            return false;
        }

        if (is_null($video)) {
            $this->message = 'This is not a valid YouTube video id.';

            return false;
        }

        if (! $video->plannedStart->isFuture()) {
            $this->message = 'We only accept streams that have not started yet.';

            return false;
        }

        return true;
    }
}
File app/Http/Livewire/SubmitYouTubeLiveStream.php (link to Github)
use App\Rules\YouTubeRule;
use Illuminate\Validation\Rule;
use Livewire\Component;

class SubmitYouTubeLiveStream extends Component
{
    //
    protected $messages = [
        'youTubeId.required' => 'The YouTube ID field cannot be empty.',
        'youTubeId.unique' => 'This stream was already submitted.',
    ];

    public function rules(): array
    {
        return [
            'youTubeId' => ['required', Rule::unique('streams', 'youtube_id'), new YouTubeRule()],
            'submittedByEmail' => 'required',
        ];
    }
    //
}

Additional resources on custom validation rules: