classes/Models/Traits/Loggable.php
private static function lookupRequestedChange()
    {
        // Only run if the query param is present
        if (!$change_id = request(Change::QUERY_KEY)) {
            return;
        }

        // Don't execute for classes that result in recusirve queries when the
        // Change model gets built below
        $class = get_called_class();
        if (in_array($class, [Change::class, Admin::class, Image::class])) {
            return;
        }

        // Check whether the referenced Change is for this class
        $change = Change::find($change_id);
        if ($class == $change->model) {
            return $change;
        }
    }
private static function lookupRequestedChange()
    {
        // Only run if the query param is present
        if (!$change_id = request(Change::QUERY_KEY)) {
            return;
        }

        // Don't execute for classes that result in recusirve queries when the
        // Change model gets built below
        $class = get_called_class();
        if (in_array($class, [Change::class, Admin::class, Image::class])) {
            return;
        }

        // Check whether the referenced Change is for this class
        $change = Change::find($change_id);
        if ($class == $change->model) {
            return $change;
        }
    }
private static function lookupRequestedChange ( ) { // Only run if the query param is present if ( ! $ change_id = request ( Change :: QUERY_KEY ) ) { return ; } // Don't execute for classes that result in recusirve queries when the // Change model gets built below $ class = get_called_class ( ) ; if ( in_array ( $ class , [ Change :: class , Admin :: class , Image :: class ] ) ) { return ; } // Check whether the referenced Change is for this class $ change = Change :: find ( $ change_id ) ; if ( $ class == $ change -> model ) { return $ change ; } }
Get a Change record mentioned in the query, if appropriate

@return Change|void
Get a Change record mentioned in the query if appropriate