PHP code example of meema / laravel-media-recognition

1. Go to this page and download the library: Download meema/laravel-media-recognition library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

meema / laravel-media-recognition example snippets


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'),

];

namespace App\Models;

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

class Media extends Model
{
    use Recognizable;

    // ...
}
bash
php artisan vendor:publish --provider="Meema\MediaRecognition\Providers\MediaRecognitionServiceProvider" --tag="config"