master

laravel/framework

Last updated at: 29/12/2023 09:24

ValidatorInterface.php

TLDR

This file defines the ValidatorInterface interface in the Illuminate\Routing\Matching namespace. It contains a single method called matches that is used to validate a rule against a route and request.

Methods

matches

Validate a given rule against a route and request.

Parameters

  • $route (\Illuminate\Routing\Route): The route to validate against.
  • $request (\Illuminate\Http\Request): The request to validate against.

Return Value

  • bool: Returns true if the rule is valid for the given route and request, false otherwise.
<?php

namespace Illuminate\Routing\Matching;

use Illuminate\Http\Request;
use Illuminate\Routing\Route;

interface ValidatorInterface
{
    /**
     * Validate a given rule against a route and request.
     *
     * @param  \Illuminate\Routing\Route  $route
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    public function matches(Route $route, Request $request);
}