PHPackages                             pkboom/google-vision - 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. pkboom/google-vision

ActiveLibrary

pkboom/google-vision
====================

v0.1(5y ago)14MITPHPPHP ^7.4

Since Aug 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/pkboom/google-vision)[ Packagist](https://packagist.org/packages/pkboom/google-vision)[ Docs](https://github.com/pkboom/google-vision)[ RSS](/packages/pkboom-google-vision/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Manage Google Vision for Laravel applications
=============================================

[](#manage-google-vision-for-laravel-applications)

[![Latest Stable Version](https://camo.githubusercontent.com/09335800c73dbc71e6ad5d2ac55961757eb710fa7766077a717666ecdec90e2a/68747470733a2f2f706f7365722e707567782e6f72672f706b626f6f6d2f676f6f676c652d766973696f6e2f76)](//packagist.org/packages/pkboom/google-vision)[![Total Downloads](https://camo.githubusercontent.com/8687459e603fa5aa60a2671d5698e83746af13d99415025717afd1987266042a/68747470733a2f2f706f7365722e707567782e6f72672f706b626f6f6d2f676f6f676c652d766973696f6e2f646f776e6c6f616473)](//packagist.org/packages/pkboom/google-vision)

This package makes working with Google Vision a breeze. Once it has been set up you can do these things:

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->text($imagePath);

// statically
use Pkboom\GoogleVision\Facades\GoogleVision;

GoogleVision::face($imagePath);
```

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

[](#installation)

You can install the package via composer:

```
composer require pkboom/google-vision
```

You must publish the configuration with this command:

```
php artisan vendor:publish --provider="Pkboom\GoogleVision\GoogleVisionServiceProvider"
```

This will publish a file called google-vision.php in your config-directory with these contents:

```
return [
    /*
     * Path to the json file containing the credentials.
     */
    'service_account_credentials_json' => storage_path('app/service-account/credentials.json'),
];
```

How to obtain the credentials to communicate with Google Vision
---------------------------------------------------------------

[](#how-to-obtain-the-credentials-to-communicate-with-google-vision)

[how to obtain the credentials to communicate with google calendar](https://github.com/spatie/laravel-google-calendar#how-to-obtain-the-credentials-to-communicate-with-google-calendar)

[google vision set up](https://cloud.google.com/vision/docs/setup)

Usage
-----

[](#usage)

### Detect text or handwriting

[](#detect-text-or-handwriting)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->text($imagePath);
```

### Detect logos

[](#detect-logos)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->logo($imagePath);

// with extension
$result = $googleVision->logo($imagePath, $imageExtension);

// with file output
$result = $googleVision
    ->output($outputFilePath);
    ->logo($imagePath);
```

### Detect crop hints

[](#detect-crop-hints)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->cropHints($imagePath);
```

### Detect document

[](#detect-document)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->document($imagePath);
```

### Detect face

[](#detect-face)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->face($imagePath, $extension, $outputPath);

// with extension
$result = $googleVision->face($imagePath, $imageExtension);

// with file output
$result = $googleVision
    ->output($outputFilePath);
    ->face($imagePath);
```

### Detect image properties

[](#detect-image-properties)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->imageProperty($imagePath);
```

### Detect image labels

[](#detect-image-labels)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->label($imagePath);
```

### Detect landmarks

[](#detect-landmarks)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->landmark($imagePath);

// with extension
$result = $googleVision->landmark($imagePath, $imageExtension);

// with file output
$result = $googleVision
    ->output($outputFilePath);
    ->landmark($imagePath);
```

### Detect objects

[](#detect-objects)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->object($imagePath);
```

### Detect explicit content

[](#detect-explicit-content)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->safeSearch($imagePath);
```

### Detect Web entities and pages

[](#detect-web-entities-and-pages)

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$googleVision = GoogleVisionFactory::create();

$result = $googleVision->web($imagePath);

// with geo results
$result = $googleVision
    ->includeGeoResult()
    ->web($imagePath);
```

### Detect pdf

[](#detect-pdf)

You can detect pdf and store it as Json on Google Cloud Storage. Destination is set to `gs://your-bucket/results` by default.

```
use Pkboom\GoogleVision\GoogleVisionFactory;

$path = 'gs://your-bucket/file.pdf';
$output = 'gs://your-bucket/any/';

$googleVision = GoogleVisionFactory::create();

$googleStorage->pdf($path, $output);

// with destination
$googleStorage
    ->to($output)
    ->pdf($path, $output);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2095d ago

### Community

Maintainers

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

---

Top Contributors

[![pkboom](https://avatars.githubusercontent.com/u/13960169?v=4)](https://github.com/pkboom "pkboom (23 commits)")

---

Tags

google-visionlaravelpkboomgoogle vision

### Embed Badge

![Health badge](/badges/pkboom-google-vision/health.svg)

```
[![Health](https://phpackages.com/badges/pkboom-google-vision/health.svg)](https://phpackages.com/packages/pkboom-google-vision)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

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