PHPackages                             mkaverin/laravel-url-login - 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. mkaverin/laravel-url-login

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

mkaverin/laravel-url-login
==========================

This package enables support for authentication with one-time secret url

2.0.3(3y ago)0701PHPPHP ^7.4|^8.0CI passing

Since May 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mish-ka-mishka/laravel-url-login)[ Packagist](https://packagist.org/packages/mkaverin/laravel-url-login)[ Docs](https://github.com/mish-ka-mishka/laravel-url-login)[ RSS](/packages/mkaverin-laravel-url-login/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (9)Versions (9)Used By (0)

Laravel url login
=================

[](#laravel-url-login)

This package enables support for authentication with one-time secret url.

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

[](#installation)

Run the following command from your project directory to add the dependency:

```
composer require mkaverin/laravel-url-login
```

Then, run database migrations:

```
php artisan migrate
```

### Laravel without auto-discovery

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the ServiceProvider to the providers array in `config/app.php`:

```
'providers' => [
    ...
    UrlLogin\Providers\UrlLoginServiceProvider::class,
],
```

Configuration
-------------

[](#configuration)

You can copy the package config with the publish command:

```
php artisan vendor:publish --provider="UrlLogin\Providers\UrlLoginServiceProvider"
```

You can find published config in `config/url-login.php`.

Usage
-----

[](#usage)

### Preparing your model

[](#preparing-your-model)

The model you want to use for authentication should use the `AuthenticatesViaUrl` trait. It provides the `createUrlLoginToken` method and `urlAuthTokens()` relation.

### Using UrlAuthController

[](#using-urlauthcontroller)

`UrlAuthController` shipped with this package is an abstract controller that provides authenticate() and logout() methods. You can use it as a base for your own controller:

```
