Download the PHP package rolfhaug/laravel-magic-link without Composer

On this page you can find all versions of the php package rolfhaug/laravel-magic-link. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-magic-link

Laravel Magic Link

This Laravel package allows you to create magic login links to let users log in to any route with a URL (without password).

The token hash is generated using the unique APP_KEY of your Laravel project as salt. The token can be appended to any route.

The package is lightweight, has no dependencies and does not perform unnecessary checks or database calls.

Installation

The package supports Laravel 5.0 and newer. Installing the package is easy and requires three steps.

Require the package

Register the middleware under the web middleware group:

Give the middleware a higher priority than \App\Http\Middleware\Authenticate::class.

Please note It must have a higher priority to work with protected routes.

Please note If you don't have the $middlewarePriority property in your Kernel.php, you can grab it from Illuminate\Foundation\Http\Kernel.php which your kernel extends.

Usage

As a user of this package you would normally generate tokens and append them to URL's.

Generate Token

The generate method takes your user model as the first argument and return a unique and secure token.

You can pass a boolean flag (defaults to false) as a second argument if you want to receive the token parameter as well

Routes and URL's

There is many ways to create the URL's you need, here is a few common ways.

Named Routes

The generateRoute method will generate the URL to a named route and append a login token.

You can pass additional arguments, like you would with the route helper.

Free hand URL

Use the optional $withParameter flag, as a second parameter, to get the configured query parameter for the tokens to easily append it to any URL.

URL built with http_build_query

Merge a token with other query parameters using the native http_build_query function.

Configuration

The package can be customized in the config/auth.php file, by adding or overwriting the following options.

User Model

The token generator require the model that is defined in the config/auth.php file under "providers.users.model". By default, this is the App\User model.

Use Cases

The package is designed to reduce friction for users. I've successfully increased valuable conversion rates with this package. Here is some ideas on when the package can be valuable.

When a user is encouraged to take action in an email or SMS

When prototyping projects or creating MVP's

Sometimes it does not make sense to have an admin-tool for all the actions a user can take. Instead you can have a "log in as user" link in the admin dashboard, and use the user dashboard to do the necessary changes.

Protip Log in as user in incognito tab to not loose your admin session :)

Example

As an admin, you might not need to be able to manage a user's address list in your ecommerce dashboard. Instead you can log in as the user, if you need to provide that support once in a while.


All versions of laravel-magic-link with dependencies

PHP Build Version
Package Version
Requires php Version 7.1.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rolfhaug/laravel-magic-link contains the following files

Loading the files please wait ....