codebuglab / laravel-env
Create and update .env file pacakge
v0.1.0
2021-06-15 11:15 UTC
Requires
- php: ^7.0
- illuminate/support: ^6.0|^7.0|^8.0
Requires (Dev)
- orchestra/canvas: ^4.0
- orchestra/testbench: ^4.0
README
Laravel small package to locate, append and update .env
keys.
Disclaimer
TO BE ABLE TO UPDATE .env
FILE THROUGH BROWSER YOU MAY NEED TO CHANGE .env
FILE PERMISSIONS TO 755. THIS WILL MAKE YOUR FILE WRITABLE VIA BROWSER.
YOU SHOULD NOT HAVE .env
IN YOUR PUBLIC ROOT, EX: public_html
Table of contents
Setup
Installation
To install this package through composer run the following command in the terminal
composer require codebuglab/laravel-env
Available methods
get
\CodeBugLab\Env::get('APP_KEY', 'default');
append
\CodeBugLab\Env::append('LOG_CHANNEL', 'daily');
replace
\CodeBugLab\Env::replace('APP_KEY', 'another key');
delete
\CodeBugLab\Env::delete('FOO');
locate
Returns a CodeBugLab\Env\Line
object
$line = \CodeBugLab\Env::locate('APP_KEY');
reset
Set to empty value
\CodeBugLab\Env::reset('APP_KEY'); // APP_KEY=""