totothegreat totothegreat - 4 years ago 157
PHP Question

define constants paths in laravel

I'm trying to this in laravel app folder:

define('PP_CONFIG_PATH', /paypal/sdk_config.ini);


The source of this is a file i created next to routes.php and filters.php and i named it constants.php.

in the laravel app folder i have a folder named paypal and inside it i have the sdk_config,

i recieve this all the time:

Use of undefined constant paypal - assumed 'paypal'
Open: C:\wamp\www\misterSurvey\app\constants.php
<?php
define('PP_CONFIG_PATH',/paypal/sdk_config.ini);
?>

Answer Source

Encapsulate the string within ' or " otherwise it will try looking for constants, and you will get a Use of undefined constant error. Like so;

define('PP_CONFIG_PATH','/paypal/sdk_config.ini');

Note: This is an error within the documentation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download