PHPackages                             leomarriel/laravel-face-detector - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leomarriel/laravel-face-detector

ActiveProject[Utility &amp; Helpers](/categories/utility)

leomarriel/laravel-face-detector
================================

A Face Detector for Laravel

v1.0.0(2y ago)3381MITPHPPHP ^8.0

Since Sep 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/leomarriel/laravel-face-detector)[ Packagist](https://packagist.org/packages/leomarriel/laravel-face-detector)[ RSS](/packages/leomarriel-laravel-face-detector/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Face Detector
=====================

[](#laravel-face-detector)

> A Laravel package to handle face detection in an image

Current Features
----------------

[](#current-features)

- reading a local or remote file
- external url support
- multiple ways available output the found face
- file validation

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

[](#installation)

```
composer require leomarriel/laravel-face-detector

```

Configuration
-------------

[](#configuration)

### Laravel without auto-discovery:

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the `FaceDetectorServiceProvider` to the providers array in `config/app.php`

```
'providers' => [
  ...
  Leomarriel\FaceDetector\FaceDetectorServiceProvider::class,
  ...
],
```

Copy configuration to your project:

```
php artisan vendor:publish --tag=facedetector-config

```

By executing above command the package configuration will be published to `config/facedetector.php`

### Config file

[](#config-file)

There are two configuration options available

`config/facedetector.php` is an asociative array with the following possible keys:

- `disk` (string): the storage disk for file save on command output `save()`.
- `noFoundFaceException` (bool): Disable the exception when a face is not found
- `padding` (array): Define a padding around the found face

Usage
-----

[](#usage)

**Direct use, no facades**:

You can create a new `FaceDetector` instance and load a local or remote file

```
use Leomarriel\FaceDetector\FaceDetector;

$face = new FaceDetector();
$face->loadFile('path/to/image.jpg');
$face->preview();
```

If you want to use the facade to face detection, add this to your facades in `config/app.php`:

```
'aliases' => [
  ...
  'FaceDetector' => Leomarriel\FaceDetector\Facades\FaceDetector::class,
  ...
],
```

Use the facade to face detection
--------------------------------

[](#use-the-facade-to-face-detection)

There are currently two ways to load the file:

### From Path

[](#from-path)

```
use FaceDetector;

$face = FaceDetector::loadFile('path/to/image.jpg')->preview();
```

### From Url

[](#from-url)

```
use FaceDetector;

$face = FaceDetector::loadUrl('https://url/to/image.jpg')->preview();
```

Output details
--------------

[](#output-details)

Check all available output ways

```
use FaceDetector;

$face = FaceDetector::loadFile('path/to/image.jpg');
```

```
$face->found(); // (bool) Return a boolean whether or not a face was found in the file
```

```
$face->face(); // (array) Return an array with the position of the found face
```

```
$face->preview(); // Return a preview of the face found with a tag
```

```
$face->json(); // Return the found face in json format
```

```
$face->stream(); // Return a response with found face cropped in JPG to show in browser
```

```
$face->output(); // Return a jpg string file with the found face
```

```
$face->save(); // Physically save the face found
```

Save details
------------

[](#save-details)

You can save the found face quickly with `$face->save()` output. The script will create a unique name for your file and store it in the `facedetector` folder in your storage.

```
$face->save(); // Physically save the face found on folder "facedetector" in your storage
```

You can set your preferred storage location:

```
$face->save('path/to/save'); // Physically save the found face with a random name in a defined path.
```

Take full control, set the storage path and file name to be saved. Save the file as JPG or PNG, it's your choice.

```
$face->save('path/to/save', 'new-image.jpg'); // Physically save the found face with a defined path and name.
```

If the save succeeds, will return the following data:

```
[
    'filename' => 'Saved file name',
    'size' => 'file size after cropping',
    'path' => 'path to file location relative to the disk storage',
    'url' => 'public url to access the file in browser'
]
```

☕️ Buy Me a Coffe
-----------------

[](#️-buy-me-a-coffe)

I'm happy to be able to contribute to your project, if this package helped you in any way, could you repay me with a coffee? Hugs!

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/leomarriel)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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

985d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89b393822ccf7ba9cb4b16e1088f2b2563d97e8bbe846447cf53bc6588161efc?d=identicon)[leomarriel](/maintainers/leomarriel)

---

Top Contributors

[![leomarriel](https://avatars.githubusercontent.com/u/14239224?v=4)](https://github.com/leomarriel "leomarriel (1 commits)")

---

Tags

laraveldetectordetectionface

### Embed Badge

![Health badge](/badges/leomarriel-laravel-face-detector/health.svg)

```
[![Health](https://phpackages.com/badges/leomarriel-laravel-face-detector/health.svg)](https://phpackages.com/packages/leomarriel-laravel-face-detector)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[nitotm/efficient-language-detector

Fast and accurate natural language detection. Detector written in PHP. Nito-ELD, ELD.

59252.9k6](/packages/nitotm-efficient-language-detector)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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