Download the PHP package abuseipdb/laravel without Composer
On this page you can find all versions of the php package abuseipdb/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abuseipdb/laravel
More information about abuseipdb/laravel
Files in abuseipdb/laravel
Package laravel
Short Description Package to easily integrate the AbuseIPDB API with Laravel.
License MIT
Homepage https://github.com/AbuseIPDB/laravel
Informations about the package laravel
AbuseIPDB
Package to easily integrate the AbuseIPDB API with your Laravel project.
Installation
You can install the package via composer:
After installing, you need to add ABUSEIPDB_API_KEY
to your .env
file.
[!NOTE] Register on abuseipdb.com to get a free API key.
Usage
Methods
All methods are static, and can be called using the AbuseIPDB
facade.
Check
Inspect details regarding the IP address queried.
Optional parameters:
maxAgeInDays
: The maximum age of reports to return (1-365), defaults to 30verbose
: Whether to include verbose information (reports), defaults to false
Report
Report an IP address to AbuseIPDB. At least one category must be specified.
Optional parameters:
comment
: An optional comment to include with the report, for example a logged indicator of attacktimestamp
: An optional timestamp to include with the report indicating the time of attack
Reports
Get the reports for a single IP address (v4 or v6).
Optional parameters:
maxAgeInDays
: The maximum age of reports to return (1-365), defaults to 30page
: The page number to get for the paginated response, defaults to 1perPage
: The number of reports to get per page (1-100), defaults to 25
Blacklist
Get the AbuseIPDB blacklist.
Optional parameters:
confidenceMinimum
: The minimum confidence score to include an IP in the blacklist (25-100), defaults to 100limit
: The maximum number of blacklisted IPs to return, defaults to 10000plaintext
: Whether to return the blacklist in plaintext (a plain array of IPs), defaults to falseonlyCountries
: Only include IPs from these countries (use 2-letter country codes)exceptCountries
: Exclude IPs from these countries (use 2-letter country codes)ipVersion
: The IP version to return (4 or 6), defaults to both
CheckBlock
Checks an entire subnet against the AbuseIPDB database.
Optional parameters:
maxAgeInDays
: The maximum age of reports to return (1-365), defaults to 30
BulkReport
Report multiple IP addresses to AbuseIPDB in bulk from a csv string.
ClearAddress
Deletes your reports for a specific address from the AbuseIPDB database.
[!NOTE] You can find a complete documentation of the available methods here.
Exceptions
In the event of an error, this package will throw an exception from the Abuseipdb\Exceptions
namespace.
Those exceptions include the following:
InvalidParameterException
: Parameter passed in was invalid for the API.
MissingAPIKeyException
: Your API key in your .env file was not found or invalid.
PaymentRequiredException
: 402 error was thrown by API, indicating feature needs a higher subscription.
TooManyRequestsException
: 429 error was thrown by API, indicating request limit has been exceeded.
UnprocessableContentException
: 422 error was thrown by API, indicating request parameters could not be handled, either missing or incorrect.
UnconventionalErrorException
: Error code other than 402, 422, or 429 was returned by the API.
Quick start for automatic reporting of suspicious operations
This package supports automatically reporting instances of Symfony's SuspiciousOperationException
.
To use this functionality, update your app\Exceptions\Handler.php
to something like this:
Now, your project will automatically report to AbuseIPDB when a SuspiciousOperationException
is thrown.
Contributing
Please see CONTRIBUTING for more information.
License
This package is licensed under the MIT License.