📜  laravel face-auth - PHP (1)

📅  最后修改于: 2023-12-03 15:32:33.366000             🧑  作者: Mango

Laravel Face-Auth - PHP

Laravel Face-Auth is a PHP package that adds facial recognition authentication to Laravel applications. This package uses the Amazon Rekognition API to perform facial recognition and store facial data.

Features
  • Add facial recognition authentication to your Laravel application
  • Uses Amazon Rekognition API for high accuracy facial recognition
  • Securely stores facial data
Installation

To install Laravel Face-Auth, use composer:

composer require christophfischer/laravel-face-auth

Once installed, add your AWS credentials and region to your .env file:

AWS_ACCESS_KEY_ID=your_access_key_id_here
AWS_SECRET_ACCESS_KEY=your_secret_access_key_here
AWS_DEFAULT_REGION=your_default_region_here

Next, publish the package's config file:

php artisan vendor:publish --provider="LaravelFaceAuth\ServiceProvider"
Usage

To use Laravel Face-Auth, add FaceAuthenticatable to your user model:

use Illuminate\Foundation\Auth\User as Authenticatable;
use LaravelFaceAuth\FaceAuthenticatable;

class User extends Authenticatable
{
    use FaceAuthenticatable;

Then, add facial data for your users:

$user = User::find($id);
$faceId = $user->addFacialData('/path/to/image');

Now, you can authenticate users with facial recognition:

$user = User::whereFace($request->file('face_image'))->first();
Configuration

Laravel Face-Auth's configuration file is located in config/laravel-face-auth.php. This file allows you to configure the package's settings, including the confidence threshold for facial recognition.

Conclusion

Laravel Face-Auth makes it easy to add facial recognition authentication to Laravel applications. With its simple installation and configuration process, you can quickly add an additional layer of security to your application.