PHPackages                             abdeslam/envator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. abdeslam/envator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abdeslam/envator
================

A fast, flexible and customizable PHP .env loader

1.0.0(5y ago)212MITPHPPHP ^8.0

Since Jun 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Abdeslam-Gacemi/Envator)[ Packagist](https://packagist.org/packages/abdeslam/envator)[ RSS](/packages/abdeslam-envator/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Envator package
===============

[](#envator-package)

**[Envator](https://github.com/Abdeslam-Gacemi/Envator.git)** is a **.env** file loader that supports loading multiple files, caching (using psr-16 simple-cache interface) and using filters that enable type casting of booleans, numerics and variables inside values and more ...

Table of contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
    - [1. Using Composer](#1-using-composer)
    - [2. Manually](#2-manually)
- [Usage](#usage)
    - [1. using the class Envator directly](#1-using-the-class-envator-directly)
    - [2. using the factory](#2-using-the-factory)
    - [3. adding filters](#3-adding-filters)
    - [4. filters using the factory](#4-filters-using-the-factory)
    - [5. custom filters](#5-custom-filters)
    - [6. options](#6-options)
    - [7. caching](#7-caching)
- [Customization](#customization)

Requirements
------------

[](#requirements)

- PHP 8.0 and above.

Installation
------------

[](#installation)

### 1. Using Composer

[](#1-using-composer)

You can install the library via [Composer](https://getcomposer.org/).

```
php composer.phar require abdeslam/envator

```

or

```
composer require abdeslam/envator

```

### 2. Manually

[](#2-manually)

If you're not using Composer, you can also clone `Abdeslam/Envator` repository into your directory:

```
git clone https://github.com/Abdeslam-Gacemi/Envator.git

```

However, using Composer is recommended as you can easily keep the library up-to-date.

Usage
-----

[](#usage)

### 1. using the class Envator directly

[](#1-using-the-class-envator-directly)

let's assume that's your `.env` file

```
APP_NAME=my_awesome_application
```

in your `php` code :

```
