PHPackages                             malezha/sentry-auth-laravel - 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. malezha/sentry-auth-laravel

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

malezha/sentry-auth-laravel
===========================

Sentry Auth Driver for Laravel

1.2.6(11y ago)1741[1 PRs](https://github.com/Malezha/sentry-auth-laravel/pulls)MITPHPPHP &gt;=5.4.0

Since Oct 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Malezha/sentry-auth-laravel)[ Packagist](https://packagist.org/packages/malezha/sentry-auth-laravel)[ Docs](http://malezha.github.io/sentry-auth-laravel/)[ RSS](/packages/malezha-sentry-auth-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (12)Used By (0)

Sentry Auth Driver for Laravel
------------------------------

[](#sentry-auth-driver-for-laravel)

[![Build Status](https://camo.githubusercontent.com/474650a97ee0996882da4701bf8fae30edacf654640464852ee4f9fbdb0f2370/68747470733a2f2f7472617669732d63692e6f72672f4d616c657a68612f73656e7472792d617574682d6c61726176656c2e737667)](https://travis-ci.org/Malezha/sentry-auth-laravel)[![Dependency Status](https://camo.githubusercontent.com/b9e75015f9b5b66283ddb36ecf3b80eea9fef7ffbbc745a1ed095c719b9c5a8a/68747470733a2f2f67656d6e617369756d2e636f6d2f4d616c657a68612f73656e7472792d617574682d6c61726176656c2e737667)](https://gemnasium.com/Malezha/sentry-auth-laravel)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fe312cdc09daefc16735e9e49ef4f39862ad40a944d453e7d020a55eea3d1d82/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d616c657a68612f73656e7472792d617574682d6c61726176656c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Malezha/sentry-auth-laravel/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/0ead62e09687379aef6dc41c139d09b990393337f227519c7b8141ed9152898d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d616c657a68612f73656e7472792d617574682d6c61726176656c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Malezha/sentry-auth-laravel/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/748e853e080f97dbd8b890cc1cccea86e3c7c27545642ccbd9fd3532da14a43c/68747470733a2f2f706f7365722e707567782e6f72672f6d616c657a68612f73656e7472792d617574682d6c61726176656c2f762f737461626c652e737667)](https://packagist.org/packages/malezha/sentry-auth-laravel)[![License](https://camo.githubusercontent.com/81a69b238221bd20f6e8da3b81821c4c0bb7ba0f938f0a2f2c4a12ff1ebf9152/68747470733a2f2f706f7365722e707567782e6f72672f6d616c657a68612f73656e7472792d617574682d6c61726176656c2f6c6963656e73652e737667)](https://packagist.org/packages/malezha/sentry-auth-laravel)

> Package is no longer supported.

Fork based on [hampel/sentry-auth-laravel](https://bitbucket.org/hampel/sentry-auth-driver-for-laravel).

Allows you to use built-in Laravel Auth routines with Cartalyst Sentry.

Laravel's built-in Auth routines allow you to configure an authentication driver for your application, which includes functionality such as sending out password reset emails.

While Cartalyst's Sentry provides the same functionality, it does so in a different and non-compatible manner, so you need to rewrite all Auth routines to use Sentry's API - you can't just change the Auth driver in Laravel.

This package allows you to do exactly that - install Sentry, install this driver and you can then configure the built-in Auth driver to use "sentry" for authentication. You'll still need to extend the functionality to implement Sentry's advanced features such as groups, permissions, login throttling and such - but at least you don't need to completely rewrite your default Auth provider.

Ideally, Cartalyst would provide this wrapper functionality as part of their own Sentry package, but until then, hopefully this package will be useful to some people.

By [Simon Hampel](http://hampelgroup.com/)and [Oleg Isaev](https://github.com/Malezha).

Versions
--------

[](#versions)

DriverLaravelSentry1.0.\*4.0.\*2.0.\*1.1.\*4.1.\*2.0.\*1.2.\*4.2.\*2.1.\*Installation
------------

[](#installation)

The recommended way of installing is through [Composer](http://getcomposer.org):

Require the packages via Composer in your `composer.json`

```
"cartalyst/sentry": "2.1.*",
"malezha/sentry-auth-laravel": "1.2.*"
```

Run Composer to update the new requirement.

```
composer update
```

Open your Laravel config file `app/config/app.php` and add the two service providers to the providers array:

```
'providers' => array(
	...
	'Cartalyst\Sentry\SentryServiceProvider',
	'Malezha\Sentry\Auth\SentryAuthServiceProvider',
	'Malezha\Sentry\Hashing\SentryHashServiceProvider',

),
```

The SentryAuthServiceProvider is where the Auth service is extended with a new "sentry" user provider.

The SentryHashServiceProvider provides a new service "sentry-hash" which provides a simple wrapper for the Sentry hashing routines.

The package also supplies an Eloquent-based User model called SentryUser, which extends the default Eloquent user model provided by Sentry and implements several required interfaces which are missing from the default Sentry model.

Make sure you've added the Sentry class alias to `app/config/app.php`:

```
'aliases' => array(
	...
	'Sentry'            => 'Cartalyst\Sentry\Facades\Laravel\Sentry'
),
```

Run packages migrations:

```
php artisan migrate --package=cartalyst/sentry
php artisan migrate --package=malezha/sentry-auth-laravel
```

If you haven't already done so, publish your Sentry config files:

```
php artisan config:publish cartalyst/sentry
```

... you should find the config files in `app/config/packages/cartalyst/sentry`

Open your Laravel config file `app/config/auth.php` and set the driver to `sentry`:

```
'driver' => 'sentry',
```

It doesn't matter which hasher you choose to use fro Sentry, our driver will simply use the same hasher in place of the built in hasher from Laravel.

Our `SentryUser` model extends Sentry's User model, but also implements some of the additional interfaces required by the Laravel Auth libraries. If you have extended our SentryUser model, you should specify the name of your own model in both the Laravel `auth.php` config file and in the Sentry `config.php` file.

For example, create a new model in `app/models/User.php`:

```
use Malezha\Sentry\Auth\SentryUser;

class User extends SentryUser
{

	/**
	* The attributes excluded from the model's JSON form.
	*
	* @var array
	*/
	protected $hidden = array(
		'password',
		'reset_password_code',
		'activation_code',
		'persist_code',
		'remember_token',
	);

}
```

You would then change `app/config/auth.php`, set the model to `User`:

```
'model' => 'User',
```

Also change `app/config/packages/cartalyst/sentry/config.php` to also set the user model to `User`:

```
'users' => array(
	'model' => 'User',
),
```

Usage
-----

[](#usage)

Implement user authentication for your Laravel application as normal, following the instructions in .

Either use the `SentryUser` model provided to replace the user model provided by Sentry, or implement your own model extending the model we have supplied.

Given that the field used as the username in Sentry can be configured, when sending user data to `Auth::attempt`, you should use the configured value rather than hard-coding the value in your code. There are two ways of retrieving this value:

```
$loginfield = \Malezha\Sentry\Auth\SentryUser::getLoginAttributeName();
```

Or you can just check the config value directly (just make sure you're not changing the login attribute name yourself dynamically at runtime!):

```
$loginfield = Config::get('cartalyst/sentry::users.login_attribute');
```

You can then use this in your controller (or elsewhere) for validation and authentication:

```
$loginfield = \Malezha\Sentry\Auth\SentryUser::getLoginAttributeName();
$passwordfield = 'password';

$credentials = array(
	$loginfield => Input::get('email'),
	$passwordfield => Input::get('password')
);

if (Auth::attempt($credentials))
{
	// successfully logged in
}
else
{
	// authentication failed
}
```

### License

[](#license)

The package is open-sourced software licensed under the [MIT license](https://github.com/Malezha/sentry-auth-laravel/blob/master/LICENSE.md)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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

Recently: every ~28 days

Total

11

Last Release

4202d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.2.0PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![simonhampel](https://avatars.githubusercontent.com/u/443890?v=4)](https://github.com/simonhampel "simonhampel (8 commits)")

---

Tags

laravelauthsentrydriver

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)[rydurham/sentinel

An implementation of the Sentry User Manager for Laravel.

31746.5k](/packages/rydurham-sentinel)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[jurager/teams

Laravel package to manage team functionality and operate with user permissions.

22817.3k](/packages/jurager-teams)[codebot/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

1596.6k](/packages/codebot-entrust)

PHPackages © 2026

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