PHP code example of osid / laravel-api-rate-limiter
1. Go to this page and download the library: Download osid/laravel-api-rate-limiter 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/ */
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UserController;
use App\Http\Controllers\OrderController;
Route::middleware(['api.rate.limiter'])->group(function () {
Route::get('/users', [UserController::class, 'index']);
Route::get('/orders', [OrderController::class, 'index']);
// Other routes
});