PHPackages                             ariaieboy/laravel-safe-browsing - 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. [API Development](/categories/api)
4. /
5. ariaieboy/laravel-safe-browsing

AbandonedArchivedLibrary[API Development](/categories/api)

ariaieboy/laravel-safe-browsing
===============================

Google Safe Browsing API Integration for LARAVEL

1.5.0(1y ago)53.5k2MITPHPPHP ~8.1.0|~8.2.0|~8.3|~8.4CI passing

Since Jan 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ariaieboy/laravel-safe-browsing)[ Packagist](https://packagist.org/packages/ariaieboy/laravel-safe-browsing)[ Docs](https://github.com/ariaieboy/laravel-safe-browsing)[ GitHub Sponsors](https://github.com/ariaieboy)[ RSS](/packages/ariaieboy-laravel-safe-browsing/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (10)Versions (12)Used By (0)

Google Safe Browsing API Integration for LARAVEL
================================================

[](#google-safe-browsing-api-integration-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3165608886442628e29085db5492ba65c93044980e1426255ade3af2b5ab2da0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617269616965626f792f6c61726176656c2d736166652d62726f7773696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ariaieboy/laravel-safe-browsing)[![GitHub Tests Action Status](https://camo.githubusercontent.com/abfbb6e6de8dab45e9c45ee08d2e0246f0e58daf8bbcde46b6db5d416b3a7883/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617269616965626f792f6c61726176656c2d736166652d62726f7773696e672f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/ariaieboy/laravel-safe-browsing/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3bb3f99778a4fc5ebea261ba12d3649ab7a57f64f03db93e79df0fc339adcb87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617269616965626f792f6c61726176656c2d736166652d62726f7773696e672f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/ariaieboy/laravel-safe-browsing/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/2734bf3f4a8f2caf3019543576d87ac530231400213241dd518fd6de5ae877b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617269616965626f792f6c61726176656c2d736166652d62726f7773696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ariaieboy/laravel-safe-browsing)

---

Using this LaravelSafeBrowsing Package you can add google safe browsing api (v4) to your laravel application.

in applications that users generates the content of the website, It's necessary to check if the content is safe or not.

one of the important features of this package is that it will help you to check URLs and if it is not safe it will return the reason why it is not safe using [google safe browsing api v4](https://developers.google.com/safe-browsing/v4).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ariaieboy/laravel-safe-browsing
```

You can publish the config file with:

```
php artisan vendor:publish --tag="safe-browsing-config"
```

This is the contents of the published config file:

```
return [
    'google'=>[
        'api_domain'=>env('SAFEBROWSING_GOOGLE_API_DOMAIN','https://safebrowsing.googleapis.com/'),
        'api_key'=>env('SAFEBROWSING_GOOGLE_API_KEY',null),
        'timeout'=>30,
        'threatTypes' => [
            'THREAT_TYPE_UNSPECIFIED',
            'MALWARE',
            'SOCIAL_ENGINEERING',
            'UNWANTED_SOFTWARE',
            'POTENTIALLY_HARMFUL_APPLICATION',
        ],

        'threatPlatforms' => [
            'ANY_PLATFORM'
        ],
        'clientId' => 'ariaieboy-safebrowsing',
        'clientVersion' => '1.0.0',
    ]
];

```

Set the api\_key in your config file or using ENV `SAFEBROWSING_GOOGLE_API_KEY`

Usage
-----

[](#usage)

```
    $result = LaravelSafeBrowsing::isSafeUrl('http://malware.testing.google.test/testing/malware/',true);
    // Return: (string) MALWARE
```

the first argument is the url that you want to check, the second argument is an optional boolean. if you don't pass the second argument or pass false the function will return true if the url is safe or false if it is not safe. if you pass true the function will return the threat type that is not safe. if the url is safe it will return true.

TODO
====

[](#todo)

- add middleware to check if the url is safe
- add verification rules to check if the url is safe
- add caching mechanism using update api

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [AriaieBOY](https://github.com/ariaieboy)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance41

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~139 days

Recently: every ~177 days

Total

9

Last Release

497d ago

PHP version history (4 changes)1.0.0PHP ~8.1.0

1.1.0PHP ~8.1.0|~8.2.0

1.2.2PHP ~8.1.0|~8.2.0|~8.3

1.4.0PHP ~8.1.0|~8.2.0|~8.3|~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15873972?v=4)[AriaieBOY](/maintainers/ariaieboy)[@ariaieboy](https://github.com/ariaieboy)

---

Top Contributors

[![ariaieboy](https://avatars.githubusercontent.com/u/15873972?v=4)](https://github.com/ariaieboy "ariaieboy (72 commits)")

---

Tags

laravelariaieboylaravel-safe-browsing

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/ariaieboy-laravel-safe-browsing/health.svg)

```
[![Health](https://phpackages.com/badges/ariaieboy-laravel-safe-browsing/health.svg)](https://phpackages.com/packages/ariaieboy-laravel-safe-browsing)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)

PHPackages © 2026

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