PHPackages                             ollyxar/laravel-auth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ollyxar/laravel-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ollyxar/laravel-auth
====================

Laravel auth helper

1.1.2(7y ago)4931MITPHPPHP &gt;=7.1

Since Oct 23Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ollyxar/laravel-auth)[ Packagist](https://packagist.org/packages/ollyxar/laravel-auth)[ RSS](/packages/ollyxar-laravel-auth/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Laravel auth helper
===================

[](#laravel-auth-helper)

[![Version](https://camo.githubusercontent.com/125ccf42faffb933bc722f4d43278efcf558c1a8ff4fe8d9b87edbba42360bc2/68747470733a2f2f706f7365722e707567782e6f72672f6f6c6c797861722f6c61726176656c2d617574682f762f737461626c652e737667)](https://camo.githubusercontent.com/125ccf42faffb933bc722f4d43278efcf558c1a8ff4fe8d9b87edbba42360bc2/68747470733a2f2f706f7365722e707567782e6f72672f6f6c6c797861722f6c61726176656c2d617574682f762f737461626c652e737667)[![Downloads](https://camo.githubusercontent.com/5657f7eade275fb4f0024085d7484ee088b724cf93c5a502006feab43649c706/68747470733a2f2f706f7365722e707567782e6f72672f6f6c6c797861722f6c61726176656c2d617574682f642f746f74616c2e737667)](https://camo.githubusercontent.com/5657f7eade275fb4f0024085d7484ee088b724cf93c5a502006feab43649c706/68747470733a2f2f706f7365722e707567782e6f72672f6f6c6c797861722f6c61726176656c2d617574682f642f746f74616c2e737667)[![License](https://camo.githubusercontent.com/df6a84cb64885e1cd0f747af9fe4e349478ecfd2b4cd8fd3a42dfac5fe23e853/68747470733a2f2f706f7365722e707567782e6f72672f6f6c6c797861722f6c61726176656c2d617574682f6c6963656e73652e737667)](https://camo.githubusercontent.com/df6a84cb64885e1cd0f747af9fe4e349478ecfd2b4cd8fd3a42dfac5fe23e853/68747470733a2f2f706f7365722e707567782e6f72672f6f6c6c797861722f6c61726176656c2d617574682f6c6963656e73652e737667)

Get user's id from session identified by cookie

### Why auth helper?

[](#why-auth-helper)

Auth helper designed for external PHP application authentication. It helps developers to get `user_id` from their session without any auth-token or any authorize process.

### How it's work?

[](#how-its-work)

Suppose you have some PHP server application that need to know who is making request. It can be some artisan command requiring authorization or WebSocket server in another port that is listening connections.

In the browser user go to some address (obviously it must have the same domain). Thus browser sends current headers to your application. And then you can use `Cookie` from the headers to define client.

[![License](https://camo.githubusercontent.com/e6ad15fa1af457cb9b405f05ca49a18d8dfcdac688dcb76da08423b07921a3d5/68747470733a2f2f6f6c6c797861722e636f6d2f75706c6f61642f696d616765732f686561646572732e6a7067)](https://camo.githubusercontent.com/e6ad15fa1af457cb9b405f05ca49a18d8dfcdac688dcb76da08423b07921a3d5/68747470733a2f2f6f6c6c797861722e636f6d2f75706c6f61642f696d616765732f686561646572732e6a7067)

### Example

[](#example)

Here is a simple example how to determine `user_id`

```
// if the sessions are in files by default
use Ollyxar\LaravelAuth\FileAuth;

// or if the sessions in the Redis
// use Ollyxar\LaravelAuth\RedisAuth;

// The same code for Redis except you have to call RedisAuth instead
if ($userId = FileAuth::getUserIdByHeaders($headers)) {
    // we got it!
}
```

You have to provide correct `$headers` array that must content Cookie item. Otherwise `$user_id` will return `false`

The headers should be like:

```
$headers = [
    'Cookie' => 'someotherkey=someothervalue;laravel_session=somerandomstring'
];
```

Please notice that auth helper use the same native methods / functions to find session by cookie.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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 ~97 days

Total

4

Last Release

2834d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94a445da70d70ada49f927d76cb247d3df7a6b4cafc5bd78abcd559d73d76e7c?d=identicon)[alexslipknot](/maintainers/alexslipknot)

---

Top Contributors

[![alexslipknot](https://avatars.githubusercontent.com/u/8543759?v=4)](https://github.com/alexslipknot "alexslipknot (1 commits)")

---

Tags

laravelauthlibrary

### Embed Badge

![Health badge](/badges/ollyxar-laravel-auth/health.svg)

```
[![Health](https://phpackages.com/badges/ollyxar-laravel-auth/health.svg)](https://phpackages.com/packages/ollyxar-laravel-auth)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[orchestra/auth

Auth Component for Orchestra Platform

24108.5k3](/packages/orchestra-auth)

PHPackages © 2026

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