Open
Description
Feature Description
Sometimes, I run a job worker by passing environment variables directly through the command line, for example:
MY_VAR=123 php artisan queue:work
In the job, I retrieve the variable using env('MY_VAR')
. However, the extension flags this with a warning that the environment variable does not exist in the .env
file. While this is generally accurate, in this specific case, the variable is expected to be provided via the command line and is intentionally absent from the .env
file.
It would be helpful to have a way to suppress this warning for such cases. For example, something like this:
class MyJob implements ShouldQueue {
public function handle() {
// laravel-extension disable-next-line no-missing-env
$myVar = env('MY_VAR');
}
}