Package Data | |
---|---|
Maintainer Username: | Sukohi |
Maintainer Contact: | capilano.sukohi@gmail.com (Sukohi) |
Package Create Date: | 2016-03-03 |
Package Last Update: | 2016-03-03 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:25:37 |
Package Statistics | |
---|---|
Total Downloads: | 37 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
A Laravel package to check if a specific URL is secure or not through Google Safe Browsing API.
This package is inspired by winternight/google-safe-browsing .
(But unfortunately I couldn't install the package via composer.)
(This is for Laravel 5+.)
Execute composer command.
composer require sukohi/google-safe-browsing:2.*
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\GoogleSafeBrowsing\GoogleSafeBrowsingServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'GoogleSafeBrowsing' => Sukohi\GoogleSafeBrowsing\Facades\GoogleSafeBrowsing::class
]
1.You need to get your API key for Google Safe Browsing API.
2.Publish the config file.
php artisan vendor:publish --force
3.Set your API key in YOUR-APP/config/google_safe_browsing.php
like so.
'api_key' => '*************************************'
if(GoogleSafeBrowsing::isSecure('https://github.com/SUKOHI')) {
echo 'Secure!';
}
After calling isSecure('URL'), call a method you want like so.
if(GoogleSafeBrowsing::isPhishing()) {
echo 'This could be a phishing site!';
}
if(GoogleSafeBrowsing::isMalware()) {
echo 'This could be a malicious software!';
}
if(GoogleSafeBrowsing::isUnwanted()) {
echo 'This could be a unwanted site!';
}
This package is licensed under the MIT License.
Copyright 2016 Sukohi Kuhoh