PHPackages                             diego-ninja/larasoul - 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. diego-ninja/larasoul

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

diego-ninja/larasoul
====================

A Verisoul integration for Laravel 10+

01PHP

Since Jul 16Pushed 9mo agoCompare

[ Source](https://github.com/diego-ninja/larasoul)[ Packagist](https://packagist.org/packages/diego-ninja/larasoul)[ RSS](/packages/diego-ninja-larasoul/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Larasoul
========

[](#larasoul)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/c9f64f714c636ba27a3bba6dfd52f98426832db1262747efa54b212d16943651/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c7565)](https://php.net/)[![Laravel Version](https://camo.githubusercontent.com/ec976ad699fb5ffbb43421eabc292424a8b0bc5bed7a28e11e6349c67e2b6599/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531322e302d726564)](https://laravel.com/)

> ⚠️ **Development Notice**: This package is currently in active development and may not be ready for production use. APIs and features may change without notice. Some features may or are incomplete or under review. Please use with caution and provide feedback on issues. As recommendation, use the `dev-main` branch for the latest features and fixes.

Larasoul is a Laravel package that provides seamless integration with the Verisoul biometric verification API. It supports identity verification through face matching, ID document verification, liveness detection, and comprehensive risk assessment.

Features
--------

[](#features)

### Core Verification Services

[](#core-verification-services)

- **Face Matching**: 1:1 biometric face verification with liveness detection
- **ID Document Verification**: Verify driver's licenses, passports, and national IDs
- **Phone Verification**: Validate phone numbers with carrier and line type information
- **Session Management**: Authenticated and unauthenticated session handling
- **Account Management**: Create, update, and manage user accounts with Verisoul

### Risk Assessment &amp; Security

[](#risk-assessment--security)

- **Risk Profiling**: Comprehensive risk assessment with configurable thresholds
- **Security Levels**: Multi-tier security requirements (none, basic, standard, premium, enterprise)
- **Risk Signals**: Detailed risk signal collection and analysis
- **Fraud Detection**: Real-time fraud attempt detection and prevention
- **Manual Review**: Automated flagging for manual review when needed

### Laravel Integration

[](#laravel-integration)

- **Eloquent Models**: `RiskProfile` and `UserVerification` models with relationships
- **Traits**: `HasRiskProfile` and `HasUserVerifications` for easy user model integration
- **Middleware**: Route protection based on verification status and risk levels
- **Events**: Comprehensive event system for verification lifecycle
- **Facades**: Simple API access through Laravel facades

### Frontend Integration

[](#frontend-integration)

- **JavaScript SDK**: Official Verisoul SDK integration with automatic script loading
- **Vue.js Support**: Composables, plugins, and components for Vue applications
- **React Support**: Hooks, contexts, and TypeScript definitions for React applications
- **Livewire Support**: Alpine.js stores and Livewire traits for seamless integration

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 12.0 or higher
- Valid Verisoul API credentials

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

[](#installation)

Install the package via Composer:

```
composer require diego-ninja/larasoul
```

Publish the configuration file:

```
php artisan vendor:publish --tag="larasoul-config"
```

Run the migrations:

```
php artisan migrate
```

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

[](#configuration)

Configure your environment variables in `.env`:

```
# Required
VERISOUL_API_KEY=your_api_key_here
VERISOUL_ENVIRONMENT=sandbox # or production

# Optional
VERISOUL_ENABLED=true
VERISOUL_TIMEOUT=30
VERISOUL_RETRY_ATTEMPTS=3
VERISOUL_RETRY_DELAY=1000

# Frontend Integration (optional)
VERISOUL_FRONTEND_ENABLED=true
VERISOUL_PROJECT_ID=your_project_id
VERISOUL_AUTO_INJECT=false
VERISOUL_SESSION_CAPTURE_ENABLED=true
```

Basic Usage
-----------

[](#basic-usage)

### Setup User Model

[](#setup-user-model)

Add the traits to your User model:

```
