Skip to main content

All Questions

Tagged with
0 votes
1 answer
23 views

AWS ECS Docker automatic environment variables injections

I will share my experience about a crazy problem on one application that I manage, that is a Laravel application publish on AWS ECS, that need to use a shared redis to store sessions and developers ...
Luca Camillo's user avatar
-1 votes
2 answers
700 views

Laravel 10 - Getting the env returns the entire .env file [closed]

I have tried a few different ways to do this, but if I do env("APP_ENV") I get the entires contents of the env file instead of the APP_ENV value I know this is bad practice but I also get ...
Neo's user avatar
  • 2,405
1 vote
1 answer
145 views

Bash: what delimiter to use for this string to array conversion to work? (Laravel/dotenv/Sail/Docker Compose)

Laravel Sail should support multiple docker-compose files by configuring them in a dotenv file (.env). The line in my .env file... SAIL_FILES='docker-compose.yml:docker-compose-arm.yml' The part of ...
Mike's user avatar
  • 71
0 votes
1 answer
1k views

Laravel (vlucas/phpdotenv) changing env values dynamically

In my test cases, I try to change some of the environment variables to create better test case coverage. Laravel by default, only support get environment variable by env($key, $default = null), I ...
Zac's user avatar
  • 1,072
1 vote
1 answer
887 views

How to change storage settings after reload custom .env file in Laravel?

I run into this issue after I loaded my custom .env.custom file in AppServiceProvider: class AppServiceProvider extends ServiceProvider { // ... public function boot() { $host = ...
netdjw's user avatar
  • 6,047
1 vote
1 answer
609 views

How to load custom .env file in Laravel console command?

I have this console command code: class MyCommand extends Command { protected $signature = 'custom:mycommand {domain}'; // ... public function handle() { $domain = $this->...
netdjw's user avatar
  • 6,047
0 votes
1 answer
649 views

github actions multiple dotenv files

I have struggled with how to write this so please bear with me. Ill try and be as clear as possible: Setup: Github repo with 3 branches (Master/Development/Staging) Each branch has a unique dotenv ...
ArcticMediaRyan's user avatar
8 votes
1 answer
7k views

Laravel Environment Variables(without default value passed in method) not working inside Artisan Command file

I am using Laravel 6.x for client's project wherein I have built an API in the Artisan Command for syncing data. Now client wants the configuration to be discreet, out of main source code and without ...
Vicky Dev's user avatar
  • 2,213
2 votes
1 answer
466 views

Laravel Lumen function env() returns null sometimes

I am developing api with Lumen 6.2.0 which gets GET request with certain parameters and token. When it gets parameters it process it in a certain way and then encode with a secret key which is in my ....
ivnku's user avatar
  • 105
0 votes
1 answer
774 views

How to Change the loaded environement in Laravel

I have to .env files .env.local and .env.pro and I don't know how to switch between files, I tried changing config\app.php from 'env' => env('APP_ENV', 'pro'), to 'env' => env('APP_ENV', '...
afccc's user avatar
  • 99
6 votes
1 answer
4k views

Return datatype from .env in Laravel

I want to have dynamic seeders based on my environment. (eg in testing I want so only seed 100 rows, whereas local it would be 10'000). I've created seeder.php in the config, which is calling values ...
n8udd's user avatar
  • 741
0 votes
1 answer
258 views

Desperately looking for a non empty $_ENV in Laravel

I have a console task ran through: $schedule->command('process:job') ->cron('* * * * *') ->withoutOverlapping(); The task is run, it can invoke different services, ...
AsTeR's user avatar
  • 7,541
0 votes
5 answers
2k views

How to override env variables in Laravel Dusk

Unfortunately config(['key' => 'newValue']) doesn't work in a Dusk setup (for overriding a config value), presumably because it would change the config of the system running the test rather than ...
Ryan's user avatar
  • 24.2k
1 vote
2 answers
3k views

Laravel 5.2 dynamic environment variables based on user

In my .env file I have two variables App_id: 12345 App_secret: abc123 But I'm wondering if there's a way so that if user userNo2 logs in then it would instead use App_id: 45678 App_secret: abc456 Is ...
Geoff_S's user avatar
  • 5,115
1 vote
2 answers
2k views

why my .env always connects with old database?

I am new to laravel. why does my laravel project keep connecting with the old database? I tried to clear cache but nothing works for me php artisan config: cache my env file is connected with the ...
user avatar

15 30 50 per page