Krato / temporal by Krato1

Laravel 5 package to create temporal url resources
22
1
3
Package Data
Maintainer Username: Krato1
Maintainer Contact: info@ericlagarda.com (Eric Lagarda)
Package Create Date: 2016-05-03
Package Last Update: 2016-05-03
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-10 15:06:22
Package Statistics
Total Downloads: 22
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Temporal Tokens for Laravel

This package generates temporary tokens to use with your models, urls, controllers or whatever you want.

Installation

Use composer to install:

composer require ericlagarda/temporal

Add provider to your config/app.php

EricLagarda\Temporal\TemporalServiceProvider::class

Temporal facade is automatically registered as an alias for EricLagarda\Temporal\Facades\Temporal class.

How to use

You have two helpers to create and recieve temporal urls.

To create your token just call create method:

$myToken = Temporal::create($modelId, $expireTime); //$expireTime in minutes to expire

To decrypt this token and check if is valid, you can use check method:

$isValid = Temporal::check($token); //$token appended to url

Method check will return false in case token is invalid. Or object with id, expires, created_at if is valid.

License

The MIT License (MIT).