Skip to content

Commit

Permalink
piping environment config through
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Aug 16, 2024
1 parent 5a96791 commit 199ce6d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/Core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,10 @@ public function isDownForMaintenance()
/**
* Gets the current environment
* @return string
* @todo implement, should be set in env
**/
public function environment()
{
return 'production';
return config('env');
}

/**
Expand Down
7 changes: 6 additions & 1 deletion app/Core/DefaultConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ class DefaultConfig
public int|bool $debug = 0;

/**
* @var bool|int Debug flag
* @var string editor used for code editing
*/
public string $editor = 'phpstorm';

/**
* @var environment
*/
public string $env = 'production';

/**
* @var string Log Path
*/
Expand Down
5 changes: 5 additions & 0 deletions app/Core/Providers/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public function boot() {

$config = $this->app->make(\Leantime\Core\Environment::class);

if (empty(config("env"))) {
config(["env" => 'production']);
}

if($config->debug) {

Debug::enable();
config(['debug' => true]);
config(['debug_blacklist' => [
Expand Down

0 comments on commit 199ce6d

Please sign in to comment.