PHP code example of clearswitch / signatrue

1. Go to this page and download the library: Download clearswitch/signatrue library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

clearswitch / signatrue example snippets


'mytoken'=>[
            'driver' => 'signatrue',
            'provider' => 'AdminUser',
        ]
'AdminUser' => [
            'driver' => 'eloquent',
            'model' => App\Models\AdminUser::class,
        ],

username;api_token;token_expired_at 这三个字段

use ClearSwitch\Signatrue\Signature;
Signature::setTokenPeriod(时间戳);
Signature::setVailRequestPeriod(时间戳);

Route::middleware('auth.signatrue')

ts,user_id,sign