{"id":15067172,"url":"https://github.com/michaelnabil230/laravel-block-ip","last_synced_at":"2026-03-06T01:03:12.631Z","repository":{"id":61682369,"uuid":"553920920","full_name":"michaelnabil230/laravel-block-ip","owner":"michaelnabil230","description":"This package is for controlling everything related to website visits using the Laravel framework","archived":false,"fork":false,"pushed_at":"2026-01-12T00:39:16.000Z","size":121,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-12T04:50:18.721Z","etag":null,"topics":["block","block-ip","blockip","ip","laravel","laravel-framework","laravel-package","many","rate-limiter","ratelimiter"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelnabil230.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-19T01:19:41.000Z","updated_at":"2026-01-12T00:39:14.000Z","dependencies_parsed_at":"2025-05-12T01:19:30.559Z","dependency_job_id":"d48c5c77-38ba-4b9c-a02d-528bc1c31b18","html_url":"https://github.com/michaelnabil230/laravel-block-ip","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":0.5833333333333333,"last_synced_commit":"e8ab5fd8c0f089db87bda3768335a2c7e8f804cb"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/michaelnabil230/laravel-block-ip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Flaravel-block-ip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Flaravel-block-ip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Flaravel-block-ip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Flaravel-block-ip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelnabil230","download_url":"https://codeload.github.com/michaelnabil230/laravel-block-ip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Flaravel-block-ip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["block","block-ip","blockip","ip","laravel","laravel-framework","laravel-package","many","rate-limiter","ratelimiter"],"created_at":"2024-09-25T01:17:34.167Z","updated_at":"2026-03-06T01:03:12.607Z","avatar_url":"https://github.com/michaelnabil230.png","language":"PHP","funding_links":["https://ko-fi.com/michaelnabil230","https://www.buymeacoffee.com/michaelnabil230","https://www.paypal.com/paypalme/MichaelNabil23"],"categories":[],"sub_categories":[],"readme":"# Laravel Block IP Package\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/michaelnabil230/laravel-block-ip.svg?style=flat-square)](https://packagist.org/packages/michaelnabil230/laravel-block-ip)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/michaelnabil230/laravel-block-ip/run-tests?label=tests)](https://github.com/michaelnabil230/laravel-block-ip/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/michaelnabil230/laravel-block-ip/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/michaelnabil230/laravel-block-ip/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/michaelnabil230/laravel-block-ip.svg?style=flat-square)](https://packagist.org/packages/michaelnabil230/laravel-block-ip)\n\nThe Laravel Block IP package provides a convenient way to control everything related to website visits using the Laravel framework. It allows you to block specific IP addresses, configure rate limiting, and receive notifications for certain events.\n\n## Installation\n\nYou can install the package via Composer by running the following command:\n\n```bash\ncomposer require michaelnabil230/laravel-block-ip\n```\n\nAfter installing the package, you need to publish the package files and run the migrations:\n\n```bash\nphp artisan block-ip:install\nphp artisan migrate\n```\n\nTo publish and run the migrations separately, you can use the following commands:\n\n```bash\nphp artisan vendor:publish --tag=\"laravel-block-ip-migrations\"\nphp artisan migrate\n```\n\nYou can also publish the package's configuration file using the following command:\n\n```bash\nphp artisan vendor:publish --tag=\"laravel-block-ip-config\"\n```\n\nThe published configuration file allows you to customize various settings related to block IP functionality, notifications, caching, and more.\n\n## Usage\n\nTo configure rate limiting and use the package's functionality, you can add code to your `app/Providers/RouteServiceProvider.php` file. The following code demonstrates how to configure rate limiting and enable the package:\n\n```php\nprotected function configureRateLimiting()\n{\n    RateLimiter::for('api', function (Request $request) {\n        return Limit::perMinute(60)-\u003eby($request-\u003euser()?-\u003eid ?: $request-\u003eip());\n    });\n\n    \\MichaelNabil230\\BlockIp\\BlockIpRegistrar::rateLimiter();\n}\n```\n\nBy default, the rate limiter is set to allow 60 requests per minute, but you can customize this value by passing it to the `rateLimiter()` method.\n\nThe package provides a `BlockIpMiddleware` middleware that you can add to your routes in the `app/Http/Kernel.php` file. Make sure to uncomment the necessary line for the `throttle` middleware as well. Here's an example:\n\n```php\nprotected $middlewareAliases = [\n    // ...\n    'block-ip' =\u003e \\MichaelNabil230\\BlockIp\\Middleware\\BlockIpMiddleware::class,\n];\n```\n\nTo protect your routes using the block IP middleware and rate limiting, you can define them as follows:\n\n```php\nRoute::middleware(['block-ip', 'throttle:block-ip'])-\u003egroup(function () {\n    // Your protected routes here\n});\n```\n\nIf you want to unblock all IP addresses, you can use the following command:\n\n```bash\nphp artisan block-ip:unblock --all\n```\n\nYou can also unblock multiple IP addresses by providing them as a comma-separated list:\n\n```bash\nphp artisan block-ip:unblock --ips=127.0.0.1,127.0.0.2\n```\n\nTo block new IP addresses, you can use the following command:\n\n```bash\nphp artisan block-ip:block 127.0.0.1 127.0.0.2\n```\n\n## Support\n\nIf you find this package useful, you can show your support by contributing financially:\n\n[![](.assets/ko-fi.png)](https://ko-fi.com/michaelnabil230)[![](.assets/buymeacoffee.png)](https://www.buymeacoffee.com/michaelnabil230)[![](.assets/paypal.png)](https://www.paypal.com/paypalme/MichaelNabil23)\n\n## Testing\n\nYou can run the package's tests using the following command:\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Michael Nabil](https://github.com/MichaelNabil230)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelnabil230%2Flaravel-block-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelnabil230%2Flaravel-block-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelnabil230%2Flaravel-block-ip/lists"}