PHPackages                             salibhdr/typhoon-url-signer - 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. [Security](/categories/security)
4. /
5. salibhdr/typhoon-url-signer

Abandoned → [salibhdr/typhoon-url-signer](/?search=salibhdr%2Ftyphoon-url-signer)Package[Security](/categories/security)

salibhdr/typhoon-url-signer
===========================

Creating and validating signed and secure URLs for both standalone and Laravel

v1.2.1.1(5y ago)883MITPHPPHP &gt;=7.0.0

Since Oct 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/SaliBhdr/typhoon-url-signer)[ Packagist](https://packagist.org/packages/salibhdr/typhoon-url-signer)[ RSS](/packages/salibhdr-typhoon-url-signer/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Typhoon Url Signer
==================

[](#typhoon-url-signer)

[![Salibhdr|typhoon](https://camo.githubusercontent.com/888a4d4c2e3a42fed2e33f3d3c1e18d93285fb88031ceba881ac9b98f5b06754/68747470733a2f2f64726976652e676f6f676c652e636f6d2f612f646f6d61696e2e636f6d2f7468756d626e61696c3f69643d3132796e744643695949474a7a4939464d55614639635274584b62307258683958)](https://camo.githubusercontent.com/888a4d4c2e3a42fed2e33f3d3c1e18d93285fb88031ceba881ac9b98f5b06754/68747470733a2f2f64726976652e676f6f676c652e636f6d2f612f646f6d61696e2e636f6d2f7468756d626e61696c3f69643d3132796e744643695949474a7a4939464d55614639635274584b62307258683958)

[![Total Downloads](https://camo.githubusercontent.com/f9d39bdd9851fc2444184a7153ee670893d5ce6f6f27d4cb40f7da737fcff217/68747470733a2f2f706f7365722e707567782e6f72672f53616c69426864722f747970686f6f6e2d75726c2d7369676e65722f646f776e6c6f616473)](https://packagist.org/packages/SaliBhdr/typhoon-url-signer)[![Latest Stable Version](https://camo.githubusercontent.com/bbe2ff0199d39be7d2ccffa22268d7b448cb7576d23161176617c1afae865a6c/68747470733a2f2f706f7365722e707567782e6f72672f53616c69426864722f747970686f6f6e2d75726c2d7369676e65722f762f737461626c65)](https://packagist.org/packages/SaliBhdr/typhoon-url-signer)[![Latest Unstable Version](https://camo.githubusercontent.com/37bac5362fde6da498ea977e61e2ce0d2ca9c76e14055b32886e817f009ab319/68747470733a2f2f706f7365722e707567782e6f72672f53616c69426864722f747970686f6f6e2d75726c2d7369676e65722f762f756e737461626c65)](https://packagist.org/packages/SaliBhdr/typhoon-url-signer)[![License](https://camo.githubusercontent.com/260a0144eddc5b86fe07294d70741c87b6eb60e054939ca316c7516625be13b5/68747470733a2f2f706f7365722e707567782e6f72672f53616c69426864722f747970686f6f6e2d75726c2d7369676e65722f6c6963656e7365)](https://packagist.org/packages/SaliBhdr/typhoon-url-signer)

Introduction
------------

[](#introduction)

Typhoon Url Signer is a package that signs and validates URLs with ease. You can make secure URLs for your files and any kind of URLs that you want so that no one can access them without permission. You can make URLs with a limited lifetime to make them expire.

You can use this package both standalone and with your Laravel application

**Features**

- Create secure URLs with expire time
- Create secure URLs without expire time
- Validate URLs
- Use both with Laravel and standalone
- Add your signers with your logic (md5, Hmac, etc.) (standalone mode)
- Add your URL signer with your logic (standalone mode)
- Add your signature (both Laravel and standalone)

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

[](#installation)

#### Install with Composer

[](#install-with-composer)

```
 $ composer require salibhdr/typhoon-url-signer
```

Getting started
---------------

[](#getting-started)

### Standalone

[](#standalone)

You are ready to use the package and no other configuration needed.

### Laravel and lumen

[](#laravel-and-lumen)

##### Laravel

[](#laravel)

Register the `UrlSignerServiceProvider`in your config/app.php configuration file:

---

```
'providers' => [

     // Other service providers...

     SaliBhdr\UrlSigner\Laravel\ServiceProviders\UrlSignerServiceProvider::class,
],
```

Run `vendor:publish` command:

```
php artisan vendor:publish --provider="SaliBhdr\UrlSigner\Laravel\ServiceProviders\UrlSignerServiceProvider"
```

It will generate the `urlSigner.php` under config directory.

Copy `URL_SIGN_KEY` to your env:

```
URL_SIGN_KEY=
```

Run the `urlSigner:generate` command to generate a signKey:

```
php artisan urlSigner:generate
```

It will generate the a sign key in `.env` file.

##### Lumen

[](#lumen)

---

Register The the `UrlSignerServiceProvider` In bootstrap/app.php:

```
$app->register(SaliBhdr\UrlSigner\Laravel\ServiceProviders\UrlSignerServiceProvider::class);
```

Copy the package config file to config directory (you may need to create one):

Copy `URL_SIGN_KEY` to your env:

```
URL_SIGN_KEY=
```

Run the `urlSigner:generate` command to generate a signKey:

```
php artisan urlSigner:generate
```

It will generate the a sign key in `.env` file.

Usage
-----

[](#usage)

### General Description

[](#general-description)

You have 3 options to sign urls:

1. With Md5 signer
2. With Hmac signer
3. With base signer

All of 3 signers above has implemented form `SaliBhdr\UrlSigner\UrlSignerInterface`and has 3 methods:

1. create($url,$params) : makes signed url base on input
2. validate($url,$params) : validates signed url throws exception base on input
3. isValid($url,$params) : validates and return true/false instead of exception

All 3 methods sign method take 2 parameters as input.The $url parameter and $params. you can pass only url with query string attach to it:

```
