PHP code example of michaelnabil230 / laravel-block-ip
1. Go to this page and download the library: Download michaelnabil230/laravel-block-ip 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/ */
michaelnabil230 / laravel-block-ip example snippets
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
\MichaelNabil230\BlockIp\BlockIpRegistrar::rateLimiter();
}