liberu-genealogy/laravel-dna

Laravel wrapper around php-dna for DNA analysis and genealogy
7,344 1
Install
composer require liberu-genealogy/laravel-dna
Latest Version:v2.2.0
PHP:>=8.3
License:MIT
Last Updated:Feb 16, 2026
Links: GitHub  ·  Packagist
Maintainer: curtisdelicata

laravel-dna

Laravel 11 or Laravel 12 wrapper around php-dna

Installation

To install the laravel-dna dependency in your Laravel project, run the following command in your terminal:

composer require liberu-genealogy/laravel-dna

This will download and install the laravel-dna package, making it available for use within your Laravel application.

Dispatching the DispatchMatchkitsJob

To dispatch the DispatchMatchkitsJob for processing DNA matchkits, you can use the following code snippet:

use LaravelDna\Jobs\DispatchMatchkitsJob;
use Dna\MatchKits;

// Option 1: Using dependency injection
dispatch(new DispatchMatchkitsJob(app(MatchKits::class)));

// Option 2: Using the service container binding
dispatch(app('dispatchMatchkits'));

This will enqueue the job for processing by the Laravel queue system. Make sure your queue worker is running to process the job.

Usage

Using the Facade

You can use the MatchKitsFacade to access MatchKits functionality:

use LaravelDna\Facades\MatchKitsFacade;
use Dna\Snps\SNPs;

// Load DNA kits
$kit1 = new SNPs('/path/to/kit1.txt');
$kit2 = new SNPs('/path/to/kit2.txt');

// Get MatchKits instance via facade
$matchKits = app('matchKits');
$matchKits->setKitsData([$kit1, $kit2]);

// Match the kits
$matchKits->matchKits();

// Get matched data
$matchedData = $matchKits->getMatchedData();

// Visualize the results
$matchKits->visualizeMatchedData('matched_data.png', 'DNA Match Results', 'GRCh37', 'png');

Direct Usage

You can also use the MatchKits class directly:

use Dna\MatchKits;
use Dna\Snps\SNPs;

$matchKits = app(MatchKits::class);

// Load your DNA kit files
$kit1 = new SNPs('/path/to/kit1.txt');
$kit2 = new SNPs('/path/to/kit2.txt');

$matchKits->setKitsData([$kit1, $kit2]);
$matchKits->matchKits();

$matchedData = $matchKits->getMatchedData();

After setting up the php-dna dependency and dispatching the DispatchMatchkitsJob, you can start integrating DNA processing functionalities into your Laravel application. Refer to the php-dna documentation for more details on available methods and their usage.

For any custom functionalities or issues, feel free to extend the job or service provider classes as needed.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v2.2.0 >=8.3 ^11.0||^12.0 MIT
v2.1.0 >=8.3 ^11.0||^12.0 MIT
v2.0.1 >=8.3 ^11.0||^12.0 MIT
v2.0.0
v1.0.0