0

I am using laravel for a project and trying to run some commands from Laravel. However, it is unable to detect the environment which is in and run the command on the correct environment

My environment structure is as below

app  
  -config    
     -production    
     -staging    
     database.php

and the way i grab the value of my environment is as below

$env = $app->detectEnvironment(function()
 {
     // Default to local if LARAVEL_ENV is not set
     return getenv('LARAVEL_ENV') ?: 'development';
 });
Matteo
  • 37,680
  • 11
  • 100
  • 115
kkh
  • 4,799
  • 13
  • 45
  • 73

1 Answers1

0

If you want to specifiy the environment for artisan to run in - you need to do

artisan migration --env=Development 

Or this this answer about how to do it differently: https://stackoverflow.com/a/13871792/1317935

Community
  • 1
  • 1
Laurence
  • 58,936
  • 21
  • 171
  • 212