PHPackages                             cosmicvelocity/lumen-helpers - 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. cosmicvelocity/lumen-helpers

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

cosmicvelocity/lumen-helpers
============================

Improves interoperability between Lumen and Laravel.

1.3.3(8y ago)661.6k↓20.8%1[1 issues](https://github.com/cosmicvelocity/lumen-helpers/issues)Apache-2.0PHPPHP &gt;=5.5.9

Since Jul 23Pushed 8y ago3 watchersCompare

[ Source](https://github.com/cosmicvelocity/lumen-helpers)[ Packagist](https://packagist.org/packages/cosmicvelocity/lumen-helpers)[ RSS](/packages/cosmicvelocity-lumen-helpers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (0)

cosmicvelocity/lumen-helpers
============================

[](#cosmicvelocitylumen-helpers)

[![Build Status](https://camo.githubusercontent.com/aed5b13080f49d924123bacf27c9ec17ea7e295c648a70af25860435570f9ec8/68747470733a2f2f7472617669732d63692e6f72672f636f736d696376656c6f636974792f6c756d656e2d68656c706572732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cosmicvelocity/lumen-helpers)

Improves interoperability between Lumen and Laravel.

Since Lumen started focusing on providing stateless APIs from 5.2, session etc etc has been removed. However, Lumen, which has a low processing speed, is also attractive for regular web application development.

Fortunately, Lumen can incorporate the components of Laravel and reintroduce the removed function. This library provides functions that are missing when you use Lumen like that.

In addition, it supports the upgrading of applications developed under Lumen 5.1, It can be used for improving implementation compatibility, assuming that you are planning to migrate to Laravel in the future.

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

[](#installation)

If composer is used, it can be introduced by adding the following description.

```
{
    "require": {
        "cosmicvelocity/lumen-helpers": ">=1.0"
    }
}
```

When using helpers related to sessions, Lumen needs to be set so that sessions can be used.

To enable sessions with Lumen 5.4, set the Application in bootstrap.php as shown below.

```
// Add required alias.
$app->alias('cookie', \Illuminate\Cookie\CookieJar::class);
$app->alias('cookie', \Illuminate\Contracts\Cookie\Factory::class);
$app->alias('cookie', \Illuminate\Contracts\Cookie\QueueingFactory::class);
$app->alias('session', \Illuminate\Session\SessionManager::class);
$app->alias('session.store', \Illuminate\Session\Store::class);
$app->alias('session.store', \Illuminate\Contracts\Session\Session::class);

// Read the configuration file.
// You need to prepare a configuration file similar to Laravel in config/session.php.
$app->configure('session');

$app->withFacades(true, [
    \Illuminate\Support\Facades\Config::class => 'Config'
]);

// Set cookie, Session service provider.
$app->register(\Illuminate\Cookie\CookieServiceProvider::class);
$app->register(\Illuminate\Session\SessionServiceProvider::class);

// Set middleware.
$app->middleware([
    \Illuminate\Cookie\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
]);
```

How to use
----------

[](#how-to-use)

The helper currently provided is as follows.

I will do the same operation as Laravel 's same name helper.

- **abort\_if**
- **abort\_unless**
- **action**
- **app\_path**
- **asset**
- **auth**
- **back**
- **bcrypt**
- **cache**
- **cookie**
- **csrf\_field**
- **csrf\_token**
- **logger**
- **method\_field**
- **mix**
- **old**
- **policy**
- **public\_path**
- **report**
- **session**
- **validator**

In addition, we provide our own helper as below.

- **app\_with**: An app () compatible helper corresponding to makeWith call. illuminate/container: From 5.4, you can not pass $parameters to make, instead makeWith prepared, By using app\_with, make can be done by passing parameters that ask Lumen, illuminate / container version.
- **redirect\_with\_session**: Since the redirect helper from Lumen 5.2 onward does not take over the session, we provide redirect\_with\_session to inherit the session. However, it must be built in advance such as SessionServiceProvider and session must be enabled in Lumen.

    ```
    return redirect_with_session(route('index'))
        ->withErrors($errors)
        ->withInput();
    ```

    By using redirect\_with\_session, you will be expecting withErrors, withInput etc. If you want to replace redirect with redirect\_with\_session you can replace it with bootstrap/app.php as follows.

    ```
    // Define redirect first.
    function redirect($to = null, $status = 302, $headers = [], $secure = null) {
      return redirect_with_session($to, $status, $headers, $secure);
    }

    require_once __DIR__ . '/../vendor/autoload.php';
    ```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~46 days

Recently: every ~26 days

Total

6

Last Release

2991d ago

PHP version history (2 changes)1.0PHP &gt;=5.4.0

1.3.3PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/d15e8c2ca0b159ae98ef0f6f36513d414aea295d1fa72332117fee293c27ed06?d=identicon)[cosmicvelocity](/maintainers/cosmicvelocity)

---

Top Contributors

[![cosmicvelocity](https://avatars.githubusercontent.com/u/1166307?v=4)](https://github.com/cosmicvelocity "cosmicvelocity (26 commits)")

---

Tags

laravellumen

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cosmicvelocity-lumen-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/cosmicvelocity-lumen-helpers/health.svg)](https://phpackages.com/packages/cosmicvelocity-lumen-helpers)
```

###  Alternatives

[artesaos/seotools

SEO Tools for Laravel and Lumen

3.3k5.1M60](/packages/artesaos-seotools)[laracrafts/laravel-url-shortener

Powerful URL shortening tools in Laravel

97110.7k](/packages/laracrafts-laravel-url-shortener)[albertcht/lumen-helpers

To support Laravel 's unsupported features in Lumen.

2931.3k1](/packages/albertcht-lumen-helpers)[proai/lumen-annotations

Route and event binding annotations for Laravel Lumen

1012.4k](/packages/proai-lumen-annotations)

PHPackages © 2026

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