PHPackages                             meema/laravel-media-recognition - 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. [Image &amp; Media](/categories/media)
4. /
5. meema/laravel-media-recognition

ActiveLibrary[Image &amp; Media](/categories/media)

meema/laravel-media-recognition
===============================

Easily &amp; quickly integrate your application with AWS Rekognition. Other drivers may be added in the near future.

1.0.1(5y ago)222.7k2[1 issues](https://github.com/meemalabs/laravel-media-recognition/issues)MITPHPPHP ^7.3|^8.0CI failing

Since Jan 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/meemalabs/laravel-media-recognition)[ Packagist](https://packagist.org/packages/meema/laravel-media-recognition)[ Docs](https://github.com/meemalabs/laravel-media-recognition)[ RSS](/packages/meema-laravel-media-recognition/feed)WikiDiscussions main Synced yesterday

READMEChangelog (5)Dependencies (6)Versions (8)Used By (0)

Media Recognition Package for Laravel
=====================================

[](#media-recognition-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2f1244c82a79e2da0f54319878ca5f26516138dec622db81b7b4745088ff9218/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65656d612f6c61726176656c2d6d656469612d7265636f676e6974696f6e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/meema/laravel-media-recognition)[![GitHub Workflow Status](https://github.com/meemalabs/laravel-media-recognition/actions/workflows/run-tests.yml/badge.svg?label=tests)](https://github.com/meemalabs/laravel-media-recognition)[![StyleCI](https://camo.githubusercontent.com/dcf3b44806977eb8c453a272768ef43b9c18f7ce066c542f0846a37ab28dc2c6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232373238303232382f736869656c643f6272616e63683d6d61696e267374796c653d666c6174)](https://github.styleci.io/repos/227280228)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cbb98b7e9db0683555c9bcf4dcc758fd773c6aa3e6afe89687dc7dff68605a3e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d65656d616c6162732f6c61726176656c2d6d656469612d7265636f676e6974696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/meemalabs/laravel-media-recognition/?branch=main)[![Total Downloads](https://camo.githubusercontent.com/5ed50e0845971691625874c3c756a4663747419663c4f572ce6f68fc28ef9c15/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65656d612f6c61726176656c2d6d656469612d7265636f676e6974696f6e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/meema/laravel-media-recognition)[![Discord](https://camo.githubusercontent.com/ec8774b75c5bc99978176a703963734077e060f31d8e989c39988fd02a7038cd/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3833343530333531363133343434313031323f6c6162656c3d646973636f726426647374796c653d666c6174)](https://discord.meema.io)[![License](https://camo.githubusercontent.com/9e6eff6ab464cc3fbcf4c03ca761f2888bcb8b58a4cbffac55f3306abd85f6e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d65656d616c6162732f6c61726176656c2d6d656469612d7265636f676e6974696f6e2e7376673f7374796c653d666c6174)](https://github.com/meemalabs/laravel-media-recognition/blob/main/LICENSE.md)

At the current state, this is a wrapper package for AWS Rekognition with some extra handy methods.

[![laravel-media-recognition package image](https://camo.githubusercontent.com/621ebaaf47e8f7a4f3632f4a1723db4dff481c55adda10252028c813aaa7eb52/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4d656469612532305265636f676e6974696f6e2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d65656d612532466c61726176656c2d6d656469612d7265636f676e6974696f6e267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d456173696c792b2532362b717569636b6c792b7265636f676e697a652b7468652b636f6e74656e742b6f662b796f75722b696d616765732b2532362b766964656f2b636f6e74656e74266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/621ebaaf47e8f7a4f3632f4a1723db4dff481c55adda10252028c813aaa7eb52/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4d656469612532305265636f676e6974696f6e2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d65656d612532466c61726176656c2d6d656469612d7265636f676e6974696f6e267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d456173696c792b2532362b717569636b6c792b7265636f676e697a652b7468652b636f6e74656e742b6f662b796f75722b696d616765732b2532362b766964656f2b636f6e74656e74266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

💡 Usage
-------

[](#-usage)

```
use Meema\MediaRecognition\Facades\Recognize;

// run any of the following methods:
// note: any of the detect*() method parameters are optional and will default to config values

// "image operations"
$recognize = Recognize::path('images/persons.jpg', 'image/jpeg'); // while the $mimeType parameter is optional, it is recommended for performance reasons
$recognize->detectLabels($minConfidence = null, $maxLabels = null)
$recognize->detectFaces($attributes = ['DEFAULT'])
$recognize->detectModeration($minConfidence = null)
$recognize->detectText()

// "video operations"
$recognize = Recognize::path('videos/amazing-video.mp4', 'video/mp4');
$recognize->startLabelDetection($minConfidence = null, $maxResults = 1000)
$recognize->startFaceDetection(string $faceAttribute = 'DEFAULT')
$recognize->startContentModeration(int $minConfidence = null)
$recognize->startTextDetection(array $filters = null)

// get the analysis/status of your jobs
$recognize->getLabelsByJobId(string $jobId)
$recognize->getFacesByJobId(string $jobId)
$recognize->getContentModerationByJobId(string $jobId)
$recognize->getTextDetectionByJobId(string $jobId)

// if you want to track your media recognitions, use the Recognizable trait on your media model && run the included migration
$media = Media::first();
$media->recognize($path)->detectFaces(); // you may chain any of the detection methods
```

🐙 Installation
--------------

[](#-installation)

You can install the package via composer:

```
composer require meema/laravel-media-recognition
```

The package will automatically register itself.

Next, publish the config file with:

```
php artisan vendor:publish --provider="Meema\MediaRecognition\Providers\MediaRecognitionServiceProvider" --tag="config"
```

Next, please add the following keys their values to your `.env` file.

```
AWS_ACCESS_KEY_ID=xxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxx
AWS_DEFAULT_REGION=us-east-1
AWS_SNS_TOPIC_ARN=arn:aws:sns:us-east-1:000000000000:RekognitionUpdate
AWS_S3_BUCKET=bucket-name
```

The following is the content of the published config file:

```
return [
    /**
     * The fully qualified class name of the "media" model.
     */
    'media_model' => \App\Models\Media::class,

    /**
     * IAM Credentials from AWS.
     */
    'credentials' => [
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
    ],

    'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),

    /**
     * Specify the version of the Rekognition API you would like to use.
     * Please only adjust this value if you know what you are doing.
     */
    'version' => 'latest',

    /**
     * The S3 bucket name where the image/video to be analyzed is stored.
     */
    'bucket' => env('AWS_S3_BUCKET'),

    /**
     * Specify the IAM Role ARN.
     *
     * You can find the Role ARN visiting the following URL:
     * https://console.aws.amazon.com/iam/home?region=us-east-1#/roles
     * Please note to adjust the "region" in the URL above.
     * Tip: in case you need to create a new Role, you may name it `Rekognition_Default_Role`
     * by making use of this name, AWS Rekognition will default to using this IAM Role.
     */
    'iam_arn' => env('AWS_IAM_ARN'),

    /**
     * Specify the AWS SNS Topic ARN.
     * This triggers the webhook to be sent.
     *
     * It can be found by selecting your "Topic" when visiting the following URL:
     * https://console.aws.amazon.com/sns/v3/home?region=us-east-1#/topics
     * Please note to adjust the "region" in the URL above.
     */
    'sns_topic_arn' => env('AWS_SNS_TOPIC_ARN'),

];
```

Preparing Your Media Model (optional)
-------------------------------------

[](#preparing-your-media-model-optional)

This package includes a trait for your "Media model" that you may use to define the relationship of your media model with the tracked recognitions.

Simply use it as follows:

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Meema\MediaRecognition\Traits\Recognizable;

class Media extends Model
{
    use Recognizable;

    // ...
}
```

### Set Up Webhooks (optional)

[](#set-up-webhooks-optional)

This package makes use of webhooks in order to communicate the updates of the AWS Rekognition job. Please follow the following steps to enable webhooks for yourself.

Please note, this is only optional, and you should only enable this if you want to track the Rekognition job's results for long-lasting processes (e.g. analyzing video).

#### Setup Expose

[](#setup-expose)

First, let's use [Expose](https://beyondco.de/docs/expose/getting-started/installation) to "expose" / generate a URL for our local API. Follow the Expose documentation on how you can get started and generate a "live" &amp; sharable URL for within your development environment.

It should be as simple as `cd my-laravel-api && expose`.

#### Setup AWS SNS Topic &amp; Subscription

[](#setup-aws-sns-topic--subscription)

Second, let's create an AWS SNS Topic which will notify our "exposed" API endpoint:

1. Open the Amazon SNS console at
2. In the navigation pane, choose Topics, and then choose "Create new topic".
3. For Topic name, enter `RekognitionUpdate`, and then choose "Create topic".

[![AWS SNS Topic Creation Screenshot](https://camo.githubusercontent.com/b16eca10dea9a8e3b35f96dd10c40bfb508f91410deac3a524488f5798916c11/68747470733a2f2f692e696d6775722e636f6d2f344d4b746675592e706e67)](https://camo.githubusercontent.com/b16eca10dea9a8e3b35f96dd10c40bfb508f91410deac3a524488f5798916c11/68747470733a2f2f692e696d6775722e636f6d2f344d4b746675592e706e67)

4. Copy &amp; note down the topic ARN which you just created. It should look similar to this: `arn:aws:sns:region:123456789012:RekognitionUpdate`.
5. On the Topic details: `RekognitionUpdate` page, in the Subscriptions section, choose "Create subscription".
6. For Protocol, choose "HTTPS". For Endpoint, enter exposed API URL that you generated in a previous step, including the API URI.

For example,

```
https://meema-api.sharedwithexpose.com/api/webhooks/media-recognition

```

7. Choose "Create subscription".

#### Confirming Your Subscription

[](#confirming-your-subscription)

Finally, we need to ensure the subscription is confirmed. By navigating to the `RekognitionUpdate` Topic page, you should see the following section:

[![AWS SNS Subscription Confirmation Screenshot](https://camo.githubusercontent.com/74abe6ddab4a2a2143203ede4771707df8bfcd82a2a7ba75e7d7ded085ff8cd3/68747470733a2f2f692e696d6775722e636f6d2f6f5450774e656e2e706e67)](https://camo.githubusercontent.com/74abe6ddab4a2a2143203ede4771707df8bfcd82a2a7ba75e7d7ded085ff8cd3/68747470733a2f2f692e696d6775722e636f6d2f6f5450774e656e2e706e67)

By default, AWS will have sent a post request to URL you defined in your "Subscription" setup. This package automatically handles the "confirmation" part. In case there is an issue and it is not confirmed yet, please click on the "Request confirmation" button as seen in the screenshot above.

You can also view the request in the Expose interface, by visiting the "Dashboard Url", which should be similar to: `http://127.0.0.1:4040`

Once the status reflects "Confirmed", your API will receive webhooks as AWS provides updates.

Deploying to Laravel Vapor
--------------------------

[](#deploying-to-laravel-vapor)

Please note, as of right now, you cannot reuse the AWS credentials stored in your "environment file". The "workaround" for this is to adjust the `media-recognition.php`-config file by renaming

From: `AWS_ACCESS_KEY_ID` - To: e.g. `VAPOR_ACCESS_KEY_ID`

From: `AWS_SECRET_ACCESS_KEY` - To: e.g. `VAPOR_SECRET_ACCESS_KEY`

and, lastly, please ensure that your Vapor environment has these values defined.

🧪 Testing
---------

[](#-testing)

```
composer test
```

📈 Changelog
-----------

[](#-changelog)

Please see our [releases](https://github.com/meemalabs/laravel-media-recognition/releases) page for more information on what has changed recently.

💪🏼 Contributing
---------------

[](#-contributing)

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

🏝 Community
-----------

[](#-community)

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Media Recognition on GitHub](https://github.com/meemalabs/laravel-media-recognition/discussions)

For casual chit-chat with others using this package:

[Join the Meema Discord Server](https://discord.meema.io)

🚨 Security
----------

[](#-security)

Please review [our security policy](https://github.com/meemalabs/laravel-media-recognition/security/policy) on how to report security vulnerabilities.

🙏🏼 Credits
----------

[](#-credits)

- [Chris Breuer](https://github.com/Chris1904)
- [Folks at Meema](https://github.com/meemalabs)
- [All Contributors](../../contributors)

📄 License
---------

[](#-license)

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

Made with ❤️ by Meema, Inc.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80.6% 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 ~13 days

Total

6

Last Release

1873d ago

Major Versions

0.2.0 → 1.0.02021-03-23

PHP version history (3 changes)0.1.0PHP ^7.4

0.2.0PHP ^7.4|^8.0

1.0.0PHP ^7.3|^8.0

### Community

Maintainers

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

---

Top Contributors

[![chrisbbreuer](https://avatars.githubusercontent.com/u/6228425?v=4)](https://github.com/chrisbbreuer "chrisbbreuer (87 commits)")[![glennmichael123](https://avatars.githubusercontent.com/u/29087513?v=4)](https://github.com/glennmichael123 "glennmichael123 (21 commits)")

---

Tags

awsimagelaravellaravel-media-recognitionrecognizerekognitionvideolaravelawsrecognitionMeemarekognitionimage analysisvideo analysis

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/meema-laravel-media-recognition/health.svg)

```
[![Health](https://phpackages.com/badges/meema-laravel-media-recognition/health.svg)](https://phpackages.com/packages/meema-laravel-media-recognition)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[meema/laravel-media-converter

Easily &amp; quickly integrate your application with AWS MediaConvert.

5790.6k](/packages/meema-laravel-media-converter)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[meema/laravel-cloudfront

Easily &amp; quickly integrate your application with AWS CloudFront.

31113.4k](/packages/meema-laravel-cloudfront)[yk/laravel-ocr

A wrapper for gocr.

1356.5k](/packages/yk-laravel-ocr)[joggapp/laravel-aws-sns

Laravel package for the SNS events by AWS

3171.8k](/packages/joggapp-laravel-aws-sns)

PHPackages © 2026

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