PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Wedmak   PHP Artisan Auth Laravel 5   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Artisan Auth Laravel 5
Laravel service provider to track visitors
Author: By
Last change:
Date: 6 years ago
Size: 1,056 bytes
 

Contents

Class file image Download

laravel-5-url-auth

Mostly for use in emails, so user can click url and get redirected with authentication. Url in email have lifetime, in hours. Monitors url visits reads, have event UrlVisit. * install

composer require iwedmak/url-auth
  • Or
    php composer.phar require iwedmak/url-auth
    
  • Or add to composer.json
    "iwedmak/url-auth": "*"
    

Register provider, add this to config/app.php in providers array:

iWedmak\UrlAuth\UrlAuthServiceProvider::class,

After that u will need to publish config

php artisan vendor:publish

and publish migrations and migrate

php artisan urlauth:migration
php artisan migrate

Now you can user urlauth($user_id, $url) function in your blade template(or anywhere), like this:

{{urlauth($user['id'], route('some.route'))}}

You can listen for \iWedmak\UrlAuth\Events\UrlVisit event. in EventServiceProvider.php

protected $listen = [
    '\iWedmak\UrlAuth\Events\UrlVisit' => [
        'App\Listeners\SomeListener',
    ],
];