PHP code example of uogsoe / basic-api-token-middleware

1. Go to this page and download the library: Download uogsoe/basic-api-token-middleware 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/ */

    

uogsoe / basic-api-token-middleware example snippets


php artisan vendor:publish

php artisan migrate

php artisan apitoken:create testservice

Route::group(['middleware' => 'apitoken:testservice'], function () {
    Route::get('/hello', function () {
        return 'hello';
    });
});

Route::group(['middleware' => 'apitoken:testservice,anotherservice'], function () {
    Route::get('/hello', function () {
        return 'hello';
    });
});