Changing default environment in Laravel 4

前端 未结 6 1805
我在风中等你
我在风中等你 2021-02-02 00:35

In Laravel 4 the default configuration environment is \'production\'. This means that if you run an artisan command without the --env option, it assumes the product

6条回答
  •  旧巷少年郎
    2021-02-02 01:18

    In bootstrap/start.php you can set the environment:

    $env = $app->detectEnvironment(function()
    {
    
        return 'development';
    
    });
    

    But you can do many things like:

    $env = $app->detectEnvironment(array(
    
        'local' => array('your-machine-name'),
    
    ));
    

    And

    $env = $app->detectEnvironment(function()
    {
        return $_SERVER['MY_LARAVEL_ENV'];
    });
    

提交回复
热议问题