Skip to content

Commit bfc0711

Browse files
Merge pull request #1 from alexkachalkov/feature/env-names
add ability for mapping environment names
2 parents d56a997 + 350ce05 commit bfc0711

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea/
2+
.vscode/
3+
.env
4+
_ide_helper.php
5+
_ide_helper_models.php
6+
.phpstorm.meta.php
7+
.DS_Store
8+
._.DS_Store
9+
**/.DS_Store
10+
**/._.DS_Store
11+
patches/

src/AdminBar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function generate()
3535

3636
$branch = $this->getBranch();
3737
$commit = $this->getCommit();
38-
$env = config('app.env');
38+
$env = array_search(config('app.env', 'prod'), config('app.env_names'), true) ?: 'prod' ;
3939
$date = $this->getCommitDate();
4040
$position = config('adminbar.position');
4141
$debugBarEnabled = config('debugbar.enabled');

src/config/adminbar.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,19 @@
2929

3030
//Namespace to nova resources
3131
'resources_namespace' => '\\App\\Nova\\',
32+
33+
/*
34+
// |--------------------------------------------------------------------------
35+
// | Environment namines
36+
// |--------------------------------------------------------------------------
37+
// |
38+
// | Fill this values for correct mapping to names in your .env values
39+
// |
40+
// */
41+
'env_names' => [
42+
'prod' => 'production',
43+
'stage' => 'staging',
44+
'dev' => 'dev',
45+
'local' => 'local'
46+
]
3247
];

0 commit comments

Comments
 (0)