master

laravel/framework

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

RouteMatched.php

TLDR

This file defines a class called RouteMatched in the Illuminate\Routing\Events namespace. The class represents an event that is triggered when a route is matched. The event includes the matched route and the corresponding request.

Classes

RouteMatched

The RouteMatched class represents an event that is triggered when a route is matched. It contains the following properties:

  • $route: Represents the matched route and is of type \Illuminate\Routing\Route.
  • $request: Represents the corresponding request and is of type \Illuminate\Http\Request.

The class has a constructor that accepts the $route and $request parameters and initializes the corresponding properties.

<?php

namespace Illuminate\Routing\Events;

class RouteMatched
{
    /**
     * The route instance.
     *
     * @var \Illuminate\Routing\Route
     */
    public $route;

    /**
     * The request instance.
     *
     * @var \Illuminate\Http\Request
     */
    public $request;

    /**
     * Create a new event instance.
     *
     * @param  \Illuminate\Routing\Route  $route
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    public function __construct($route, $request)
    {
        $this->route = $route;
        $this->request = $request;
    }
}