0

In Laravel 4, how can we have

$pathToFile = '/var/www/awesome'
$mysqlServer = '111.111.111.0'

when domain of the site is www.mysite.com, and

$pathToFile = '/var/www/hackish'
$mysqlServer = '111.111.111.1'

when domain of the site is dev.mysite.com?

1 Answer 1

2

Create a different environment for each domain, under bootstrap/start.php, and add specific file for it, under app/start folder. In your example, you could have:

bootstrap/start.php

// ...
$env = $app->detectEnvironment(array(
    'production'  => array('www.mysite.com'),
    'development' => array('dev.mysite.com'),
));

app/start/production.php

$pathToFile = '/var/www/awesome';
$mysqlServer= '111.111.111.0';

app/start/development.php

$pathToFile = '/var/www/hackish';
$mysqlServer= '111.111.111.1';

You should not though, that if you're working with the default configuration files, the same is valid for them. You can read more on the documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.