codebuglab/laravel-env

Create and update .env file pacakge

v0.1.0 2021-06-15 11:15 UTC

This package is auto-updated.

Last update: 2024-11-12 18:15:35 UTC


README

Laravel small package to locate, append and update .env keys.

Laravel env

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=""