Laravel - Undefined variable: relative


#1

Can you please help, went through the documentation but don’t know what am missing…


#2

Hi @iamtatendakagande May you share your logs that show the error


#3

C:\xampp\htdocs\dunda\vendor\paynow\php-sdk\autoloader.php:25

/**

  • Root namespace for the application

*/

define(‘ROOT_NAMESPACE’, ‘Paynow\’);

/**

*/

spl_autoload_register(function($class) {

    // Remove the root namespace

    if (substr($class, 0, strlen(ROOT_NAMESPACE)) == ROOT_NAMESPACE) {

        $relative = substr($class, strlen(ROOT_NAMESPACE));

    }



    // Bring in the file

    $filename = __DIR__ . "/src/" . str_replace('\\', '/', $relative) . ".php";



    // Check if the file exists

    if (file_exists($filename)) {

        require_once($filename);

        if (class_exists($class)) {

            return true;

        }

    }



    return false;

});


#4

@iamtatendakagande what is the problem which you are having?


#5

@James as i posted above Undefined variable: relative is the error am getting. I suspect
http://example.com/gateways/paynow/update’ is the root cause of the error. I have no idea which gateways should i use.


#6

@iammerus are you able to suggest anything?