PHPackages                             watson/autologin - 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. watson/autologin

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

watson/autologin
================

Autologin package for Laravel

0.5.3(8y ago)7871.4k34[1 issues](https://github.com/dwightwatson/autologin/issues)MITPHPPHP &gt;=5.5.0

Since Feb 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dwightwatson/autologin)[ Packagist](https://packagist.org/packages/watson/autologin)[ RSS](/packages/watson-autologin/feed)WikiDiscussions master Synced yesterday

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

Autologin for Laravel
=====================

[](#autologin-for-laravel)

Autologin is a package built specifically for Laravel 4/5 that will allow you to generate URLs that will provide automatic login to your application and then redirect to the appropriate location. By default, it supports the Laravel Auth facility, but I hope to expand that to others (Sentry, Entrust) as well as custom support in the future.

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

[](#installation)

Pop this in your `composer.json` file and run `composer update` (this might differ depending on how or where you installed Composer).

```
composer require watson/autologin

```

Now, add the Autologin service provider to your `app/config/app.php` file.

`Watson\Autologin\AutologinServiceProvider::class`

If you want to adjust the default settings from the sensible defaults, publish the configuration file.

`php artisan vendor:publish --provider="Watson\Autologin\AutologinServiceProvider" --tag="config"`

To get the migrations, publish them.

`php artisan vendor:publish --provider="Watson\Autologin\AutologinServiceProvider" --tag="migrations"`

And of course, if you'd like to use a Facade instead of injecting the class itself, add this to the aliases array.

`'Autologin' => Watson\Autologin\Facades\Autologin::class`

Then, add the route to your `routes.php` file, naming it `autologin`. If you'd like to name it something else, ensure you also change that in the configuration file. You can use the provided `AutologinController` or route to a controller of your own.

```
Route::get('autologin/{token}', ['as' => 'autologin', 'uses' => '\Watson\Autologin\AutologinController@autologin']);

```

Note that previous versions of the package would add this route automatically. I removed this to enable you to better control the route middleware groups in your application to start the session and so on.

Generating a autologin link
---------------------------

[](#generating-a-autologin-link)

### Autologin link for a user

[](#autologin-link-for-a-user)

```
// User class implements UserInterface
$user = User::find(1);

// http://example.com/autologin/Mx7B1fsUin
$link = Autologin::user($user);

```

### Autologin link for a user with a path

[](#autologin-link-for-a-user-with-a-path)

```
// User class implements UserInterface
$user = User::find(1);

// http://example.com/autologin/RvcNoAcH0X
$link = Autologin::to($user, '/profile');

```

### Autologin link for a user with a route

[](#autologin-link-for-a-user-with-a-route)

```
// User class implements UserInterface
$user = User::find(1);

// http://example.com/autologin/3eQOsRnvPE
$link = Autologin::route($user, 'posts.index');

```

Validating a token
------------------

[](#validating-a-token)

If you take a look at `Watson\Autologin\AutologinController` you'll see how the packages validates tokens, logs in and then redirects the user. If you wish to use a different approach, copy the controller into your own application, swap out what you want to change and then set the controller in the Autologin configuration file.

Authentication
--------------

[](#authentication)

By default, Autologin works with Laravel's Auth library. You can publish the configuration file to switch to the built-in Sentry provider. It's super easy to implement your own provider: swap it out and implement `Watson\Autologin\Interfaces\AuthenticationInterface`. Feel free to make a PR for other authentication libraries you'd like to support.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 86.6% 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 ~41 days

Recently: every ~47 days

Total

35

Last Release

3136d ago

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

0.4.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1100408?v=4)[Dwight Watson](/maintainers/dwightwatson)[@dwightwatson](https://github.com/dwightwatson)

---

Top Contributors

[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (58 commits)")[![ci-chrisjsimpson](https://avatars.githubusercontent.com/u/73409187?v=4)](https://github.com/ci-chrisjsimpson "ci-chrisjsimpson (2 commits)")[![mtrmakhil](https://avatars.githubusercontent.com/u/4418315?v=4)](https://github.com/mtrmakhil "mtrmakhil (2 commits)")[![mnabialek](https://avatars.githubusercontent.com/u/7656807?v=4)](https://github.com/mnabialek "mnabialek (1 commits)")[![v-six](https://avatars.githubusercontent.com/u/3017033?v=4)](https://github.com/v-six "v-six (1 commits)")[![pkunze](https://avatars.githubusercontent.com/u/1416798?v=4)](https://github.com/pkunze "pkunze (1 commits)")[![stealthAngel](https://avatars.githubusercontent.com/u/23656202?v=4)](https://github.com/stealthAngel "stealthAngel (1 commits)")[![hongaar](https://avatars.githubusercontent.com/u/205834?v=4)](https://github.com/hongaar "hongaar (1 commits)")

---

Tags

laravelautologin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/watson-autologin/health.svg)

```
[![Health](https://phpackages.com/badges/watson-autologin/health.svg)](https://phpackages.com/packages/watson-autologin)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M305](/packages/laravel-horizon)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)

PHPackages © 2026

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