PHPackages                             reksakarya/laravel-signature - 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. reksakarya/laravel-signature

ActiveLibrary[Security](/categories/security)

reksakarya/laravel-signature
============================

Secure with signature

v3.0.0(1y ago)01651PHPPHP ^7.3.0|^8.0

Since Oct 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/masovin/laravel-hmac-signature)[ Packagist](https://packagist.org/packages/reksakarya/laravel-signature)[ RSS](/packages/reksakarya-laravel-signature/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Laravel Signature
=================

[](#laravel-signature)

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

[](#introduction)

Laravel Signature will help you to secure data by identifying who is accessing your end-point with signature

Requirements
------------

[](#requirements)

At this time, Laravel Signature only support:

- Laravel ^7.x. | ^8.x
- PHP ^7.3.0 | ^8.0

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

[](#installation)

1. run `composer require reksakarya/laravel-signature`.
2. add autoload to `composer.json`

```
...
  "autoload": {
    "psr-4": {
      ...
      "LaravelSignature\\": "vandor/reksakarya/laravel-signature/src",
      ...
    }
  }
...

```

3. run command `composer dump-autoload`
4. add provider to `config/app.php

```
  "providers" => [
    ...
    /*
    * Package Service Providers...
    */
    LaravelSignature\SignatureServiceProvider::class,
    ...
  ]

```

5. To publish signature config into application, run:

```
$ php artisan vendor:publish --tag=laravel-signature

```

6. next, we need to setup environtment variable on your `.env` :

```
SIGNATURE_EPNBP_ID=
SIGNATURE_EPNBP_KEY=
SIGNATURE_EPNBP_SECRET=
SIGNATURE_KERJASAMABU_ID=
SIGNATURE_KERJASAMABU_KEY=
SIGNATURE_KERJASAMABU_SECRET=
SIGNATURE_JASAPERBANKAN_ID=
SIGNATURE_JASAPERBANKAN_KEY=
SIGNATURE_JASAPERBANKAN_SECRET=
SIGNATURE_PENDAPTANLAINLAIN_ID=
SIGNATURE_PENDAPTANLAINLAIN_KEY=
SIGNATURE_PENDAPTANLAINLAIN_SIGNATURE=

```

7. dont forget to run `php artisan config:cache` to save your config change on cache

then, the installation proccess was complete

How to use
----------

[](#how-to-use)

by default, Reksa Karya Laravel Signature create signature for existing application **E-PNBP Telekomunikasi, E-PNBP POS, Kerjasama Badan Usaha, Management Kas, and Pendapatan Lain Lain**

To create signature, call Signature on your class and you can call static method `Signature::make(string $url, array $credential)` or you can specific on your apps :

> Note! `$credential` variable should be array with value like this:
>
> ```
> $credentiial = [
>     id: $your-signature-id
>     key: $your-signature-key
>     secret: $your-signature-secret
> ];
>
> ```

```
