src/Active.php
public function checkRouteParam($param, $value)
    {
        if (!$this->route) {
            return false;
        }

        $paramValue = $this->route->parameter($param);

        // If the parameter value is an instance of Model class, we compare $value with the value of
        // its primary key.
        if (is_a($paramValue, Model::class)) {
            return $paramValue->{$paramValue->getKeyName()} == $value;
        }

        return $paramValue == $value;
    }
public function checkRouteParam($param, $value)
    {
        if (!$this->route) {
            return false;
        }

        $paramValue = $this->route->parameter($param);

        // If the parameter value is an instance of Model class, we compare $value with the value of
        // its primary key.
        if (is_a($paramValue, Model::class)) {
            return $paramValue->{$paramValue->getKeyName()} == $value;
        }

        return $paramValue == $value;
    }
public function checkRouteParam ( $ param , $ value ) { if ( ! $ this -> route ) { return false ; } $ paramValue = $ this -> route -> parameter ( $ param ) ; // If the parameter value is an instance of Model class, we compare $value with the value of // its primary key. if ( is_a ( $ paramValue , Model :: class ) ) { return $ paramValue -> { $ paramValue -> getKeyName ( ) } == $ value ; } return $ paramValue == $ value ; }
Check if the parameter of the current route has the correct value

@param $param
@param $value

@return bool
Check if the parameter of the current route has the correct value