PHPackages                             elle-the-dev/oatmeal - 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. elle-the-dev/oatmeal

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

elle-the-dev/oatmeal
====================

PHP cookie management in a modern, object-oriented manner.

v1.0.0(6y ago)03[2 PRs](https://github.com/elle-the-dev/oatmeal/pulls)MITPHPPHP ^7.0

Since Dec 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/elle-the-dev/oatmeal)[ Packagist](https://packagist.org/packages/elle-the-dev/oatmeal)[ RSS](/packages/elle-the-dev-oatmeal/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (4)Used By (0)

Oatmeal
-------

[](#oatmeal)

Oatmeal is a cookie manager for modern, object-oriented PHP development. Oatmeal works both as a standalone package, as well as having built-in integration into Laravel.

### Requirements

[](#requirements)

Oatmeal requires PHP 7.0 and higher.

### Installation

[](#installation)

Installation is done via composer

```
composer require elle-the-dev/oatmeal
```

If we want to integrate into Laravel, we'll additionally want to run

```
php artisan vendor:publish
```

This will publish the config file to `config/oatmeal.php`.

Also for Laravel, if we don't use auto-discovery, we'll need to add `OatmealServiceProvider` to the providers array in `config/app.php`

```
ElleTheDev\Oatmeal\Providers\OatmealServiceProvider::class,
```

### Usage

[](#usage)

#### Instantiation

[](#instantiation)

Ideally we'll be using Oatmeal with a side of dependency injection, but this is what it looks like to instantiate a new instance on its own.

```
$oatmeal = new ElleTheDev\Oatmeal\Oatmeal;
```

Configuration can be passed in via the constructor so we don't need to specify path, domain, https and http-only settings each time we want to set a cookie.

```
$oatmeal = new ElleTheDev\Oatmeal\Oatmeal([
    'path' => '/',
    'domain' => 'example.com',
    'secure' => false,
    'httpOnly' => true,
]);
```

In Laravel, the service provider allows for auto-injecting the Oatmeal interface and autoloading the config from `config/oatmeal.php`

```
use ElleTheDev\Oatmeal\Contracts\Oatmeal;

class ExampleController extends Controller
{
    public function show(Oatmeal $oatmeal)
    {
    }
}
```

When injecting in Laravel, Oatmeal will automatically be loaded using the config file `config/oatmeal.php`.

#### Setting

[](#setting)

We can set a basic cookie with a timeout in minutes. `set` will also update the `$_COOKIE` superglobal array with the new cookie value.

```
$oatmeal->set('name', 'value', 60);
```

We can also store a cookie with no expiration (note: it technically expires in ~5 years)

```
$oatmeal->forever('name', 'value');
```

If we need to change settings before setting a cookie, we can do so through chained method calls.

```
$oatmeal->setPath('/')
    ->setDomain('example.com')
    ->setSecure(false)
    ->setHttpOnly(true)
    ->set('name', 'value', 60);
```

#### Getting

[](#getting)

Getting a cookie is as simple as calling `get`. If the requested cookie does not exist or is expired, `get` will return `null`

```
$value = $oatmeal->get('name');
```

If we'd like to forget the cookie after getting it, we can `pull` instead. `pull` will also update the `$_COOKIE` superglobal to remove the pulled cookie.

```
$value = $oatmeal->pull('name');
```

#### Deleting

[](#deleting)

We can delete a cookie using `forget`

```
$oatmeal->forget('name');
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2403d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7dac383dd4c0fb57f4dddc19ea2b70620af00af59b7f166b59c983d2f6beaf26?d=identicon)[ellesaurus](/maintainers/ellesaurus)

---

Top Contributors

[![elle-the-dev](https://avatars.githubusercontent.com/u/272878?v=4)](https://github.com/elle-the-dev "elle-the-dev (1 commits)")

---

Tags

phpcookiemanagesetcookie

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elle-the-dev-oatmeal/health.svg)

```
[![Health](https://phpackages.com/badges/elle-the-dev-oatmeal/health.svg)](https://phpackages.com/packages/elle-the-dev-oatmeal)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21623.4k](/packages/imanghafoori-laravel-anypass)[marcogermani87/filament-cookie-consent

Easy cookie consent integrations for Filament

1917.6k](/packages/marcogermani87-filament-cookie-consent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
