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, (*1)
composer require iwedmak/url-auth
php composer.phar require iwedmak/url-auth
"iwedmak/url-auth": "*"
Register provider, add this to config/app.php in providers array:, (*2)
iWedmak\UrlAuth\UrlAuthServiceProvider::class,
After that u will need to publish config, (*3)
php artisan vendor:publish
and publish migrations and migrate
``` bash
php artisan urlauth:migration
php artisan migrate, (*4)
Now you can user `urlauth($user_id, $url)` function in your blade template(or anywhere), like this:
``` bash
{{urlauth($user['id'], route('some.route'))}}
You can listen for \iWedmak\UrlAuth\Events\UrlVisit
event.
in EventServiceProvider.php
bash
protected $listen = [
'\iWedmak\UrlAuth\Events\UrlVisit' => [
'App\Listeners\SomeListener',
],
];
, (*5)