2017 © Pedro Peláez
 

library autologin

Autologin package for Laravel

image

watson/autologin

Autologin package for Laravel

  • Friday, December 1, 2017
  • by dwightwatson
  • Repository
  • 8 Watchers
  • 66 Stars
  • 31,991 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 1 Open issues
  • 37 Versions
  • 4 % Grown

The README.md

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., (*1)

Installation

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

composer require watson/autologin

Now, add the Autologin service provider to your app/config/app.php file., (*3)

Watson\Autologin\AutologinServiceProvider::class, (*4)

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

php artisan vendor:publish --provider="Watson\Autologin\AutologinServiceProvider" --tag="config", (*6)

To get the migrations, publish them., (*7)

php artisan vendor:publish --provider="Watson\Autologin\AutologinServiceProvider" --tag="migrations", (*8)

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

'Autologin' => Watson\Autologin\Facades\Autologin::class, (*10)

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., (*11)

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., (*12)

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

// http://example.com/autologin/Mx7B1fsUin
$link = Autologin::user($user);
// User class implements UserInterface
$user = User::find(1);

// http://example.com/autologin/RvcNoAcH0X
$link = Autologin::to($user, '/profile');
// User class implements UserInterface
$user = User::find(1);

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

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., (*13)

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., (*14)

The Versions

01/12 2017

dev-master

9999999-dev

Autologin package for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

01/12 2017

0.5.3

0.5.3.0

Autologin package for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

05/09 2017

0.5.2

0.5.2.0

Autologin package for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

15/08 2017

0.5.1

0.5.1.0

Autologin package for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

20/07 2017

0.5.0

0.5.0.0

Autologin package for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

26/05 2017

0.4.4

0.4.4.0

Autologin package for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

28/01 2017

0.4.3

0.4.3.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

25/01 2017

0.4.2

0.4.2.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

21/03 2016

0.4.1

0.4.1.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

20/03 2016

0.4.0

0.4.0.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

21/07 2015

0.3.4

0.3.4.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

21/07 2015

dev-fix/broken-tree

dev-fix/broken-tree

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

15/07 2015

0.3.3

0.3.3.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

13/03 2015

0.3.2

0.3.2.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

13/03 2015

0.3.1

0.3.1.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

05/03 2015

0.3.0

0.3.0.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

01/01 2015

0.2.x-dev

0.2.9999999.9999999-dev

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

01/01 2015

0.2.14

0.2.14.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

20/11 2014

0.2.13

0.2.13.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

16/10 2014

0.2.12

0.2.12.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

03/10 2014

0.2.11

0.2.11.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

03/10 2014

0.2.10

0.2.10.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

03/10 2014

0.2.9

0.2.9.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

02/10 2014

0.2.8

0.2.8.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

03/06 2014

0.2.7

0.2.7.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

17/03 2014

0.2.6

0.2.6.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

08/03 2014

0.2.5

0.2.5.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

07/03 2014

0.2.4

0.2.4.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

07/03 2014

0.2.3

0.2.3.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

07/03 2014

0.2.2

0.2.2.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

07/03 2014

0.2.1

0.2.1.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

02/03 2014

0.2.0

0.2.0.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

02/03 2014

0.1.4

0.1.4.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

07/02 2014

0.1.3

0.1.3.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

05/02 2014

0.1.2

0.1.2.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

05/02 2014

0.1.1

0.1.1.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin

05/02 2014

0.1.0

0.1.0.0

Autologin package for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dwight Watson

laravel autologin