PHPackages                             codekj/safebrowsing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. codekj/safebrowsing

ActiveLibrary

codekj/safebrowsing
===================

Laravel package to allow you to easily integrate the Google Safebrowing API into your application.

0.1.0(9y ago)010GPLPHPPHP ~5.5|~7.0

Since Jun 30Pushed 5y agoCompare

[ Source](https://github.com/CodeKJ/Safebrowsing)[ Packagist](https://packagist.org/packages/codekj/safebrowsing)[ Docs](https://github.com/Snipe/Safebrowsing)[ RSS](/packages/codekj-safebrowsing/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Safebrowsing
============

[](#safebrowsing)

[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/snipe/safebrowsing?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://camo.githubusercontent.com/9b6616607ca9a79a188591134fb4d07610d3a040908ada0fdbf92f77c1689af1/68747470733a2f2f7472617669732d63692e6f72672f736e6970652f5361666562726f7773696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/snipe/Safebrowsing) [![Latest Stable Version](https://camo.githubusercontent.com/9846fa690f73d4de2c7dff53815b06a04b62b96b5f18e6fe9d5ecc8c55775520/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f7361666562726f7773696e672f762f737461626c652e737667)](https://packagist.org/packages/snipe/safebrowsing) [![Total Downloads](https://camo.githubusercontent.com/a506fd554089e67c5a0ac4757d4e08e29eba98737e5c8bf9fdc4b2e0d8bf59d5/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f7361666562726f7773696e672f646f776e6c6f6164732e737667)](https://packagist.org/packages/snipe/safebrowsing) [![Latest Unstable Version](https://camo.githubusercontent.com/aebe60acea94bba6faa29ff45d7b596ae27eee09945978c2287ddada1ffe6bca/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f7361666562726f7773696e672f762f756e737461626c652e737667)](https://packagist.org/packages/snipe/safebrowsing) [![License](https://camo.githubusercontent.com/45e500f55f1e83df93c3ae8714dd502427c49c4989a14eac58ec263c4440acc9/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f7361666562726f7773696e672f6c6963656e73652e737667)](https://packagist.org/packages/snipe/safebrowsing) [![Codacy Badge](https://camo.githubusercontent.com/d1b017b30327f4d15299b13a2c0d7ea902abe3b5c1c3dae331e705b363b1760c/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6562323137363561313430313431653638323830333561333736373333613830)](https://www.codacy.com/app/snipe/Safebrowsing?utm_source=github.com&utm_medium=referral&utm_content=snipe/Safebrowsing&utm_campaign=Badge_Grade)

This is a Laravel 5 package to enable you to easily interface with the Google Safebrowsing API. (Other RBL services are coming.)

Right now it's only using the [Google Safebrowsing Lookup API](https://developers.google.com/safe-browsing/v4/lookup-api) (v4), but I'll be updating it to include the Update API as well. The [old Safebrowsing v3 (non-package) version](http://snipe.net/2014/04/check-user-submitted-urls-for-malware-and-phishing-in-your-application/) of this script has also included Phishtank and several RBLs, but I think the RBLs have changed how they work so that old code doesn't work anymore.

**This package requires that you have [an active Google Safebrowsing API key](https://developers.google.com/safe-browsing/v4/get-started). It absolutely will not work without one.** It's free to create an API key (although the process is every bit as confusing and convoluted as you would expect from Google).

Bear in mind that Google does throttle API usage, so if you have a high-traffic site, you may want to build in a caching layer or something so you don't burn through your requests too quickly. You can keep an eye on your usage through the [Google API console](https://console.developers.google.com/apis/api/safebrowsing.googleapis.com/usage).

**This package is very rough around the edges and probably shouldn't be used for production yet.**

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
$ composer require snipe/safebrowsing
```

### Update Your Config

[](#update-your-config)

#### For applications using Laravel =&lt; 5.4

[](#for-applications-using-laravel--54)

Open `config/app.php` and add:

```
Snipe\Safebrowsing\SafebrowsingServiceProvider::class,
```

to your `providers` array in `config/app.php`, and:

```
'Safebrowsing' => Snipe\Safebrowsing\Facade\Safebrowsing::class,
```

to your `aliases` array in `config/app.php`.

### Publish the config

[](#publish-the-config)

```
php artisan vendor:publish
```

### Set Your Google Safebrowsing API Key

[](#set-your-google-safebrowsing-api-key)

In your `.env`, add:

```
GOOGLE_API_KEY=YOUR-ACTUAL-API-KEY
```

There are additional options in the config file that relate to what specific types of threats you want to check for, and what platforms you want to check on, but you only really need to worry about that if you want to check *fewer* things, as it's pretty inclusive already.

Usage
-----

[](#usage)

### Using Blade Syntax

[](#using-blade-syntax)

```
{{ Safebrowsing::checkSafeBrowsing($urls) }}
```

or

```
@if (Safebrowsing::isFlagged('http://twitter.com/'))
    // do something if the url is flagged as suspicious
@else
    // hooray - it's not flagged!
@endif
```

where `$url` is an array of URLs that you would like to check against the Google Safebrowsing API.

### Using Facades

[](#using-facades)

```
Safebrowsing::addCheckUrls(['http://ianfette.org']);
Safebrowsing::addCheckUrls(['http://malware.testing.google.test/testing/malware/']);
Safebrowsing::execute();
print('Status of the third URL is: '.Safebrowsing::isFlagged('http://twitter.com/'));
```

Test URLs
---------

[](#test-urls)

Here are some handy test urls you can use while you're experimenting with the system.

-  (OK)
-  (OK)
-  (Malware)
-  (OK)
-  (malware)
-  (OK)

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

From the package

```
`../../../vendor/bin/phpunit`
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [A. Gianotto](https://github.com/snipe)
- [All Contributors](../../contributors)

License
-------

[](#license)

GNU GENERAL PUBLIC LICENSE. Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3609d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4a107ca99dba90a8ecab2585d84917512a2573e31c9bbe1154571468a9ac41f?d=identicon)[CodeKJ](/maintainers/CodeKJ)

---

Top Contributors

[![snipe](https://avatars.githubusercontent.com/u/197404?v=4)](https://github.com/snipe "snipe (30 commits)")[![citronkaste](https://avatars.githubusercontent.com/u/4586464?v=4)](https://github.com/citronkaste "citronkaste (4 commits)")[![flashadvocate](https://avatars.githubusercontent.com/u/7848492?v=4)](https://github.com/flashadvocate "flashadvocate (3 commits)")[![mrehayden1](https://avatars.githubusercontent.com/u/547652?v=4)](https://github.com/mrehayden1 "mrehayden1 (1 commits)")

---

Tags

urlgooglemalwaresafebrowsingrblSnipe

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/codekj-safebrowsing/health.svg)

```
[![Health](https://phpackages.com/badges/codekj-safebrowsing/health.svg)](https://phpackages.com/packages/codekj-safebrowsing)
```

###  Alternatives

[snipe/safebrowsing

Laravel package to allow you to easily integrate the Google Safebrowing API into your application.

1223.9k](/packages/snipe-safebrowsing)[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[mbarwick83/shorty

Google Url Shortener API Package for Laravel 5.1

31204.9k](/packages/mbarwick83-shorty)[codeat3/blade-google-material-design-icons

A package to easily make use of "Google Fonts Material Icons" in your Laravel Blade views.

23494.4k4](/packages/codeat3-blade-google-material-design-icons)[osiemsiedem/laravel-autolink

A Laravel package for converting URLs in a given string of text into clickable links.

13126.3k](/packages/osiemsiedem-laravel-autolink)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
