liberu-genealogy / laravel-gedcom
A package that converts gedcom files to Eloquent models
Fund package maintenance!
liberu-genealogy
Installs: 2 866
Dependents: 2
Suggesters: 0
Security: 0
Stars: 79
Watchers: 3
Forks: 48
Open Issues: 0
Requires
- php: >=8.4
- illuminate/database: ^11.0||^12.0
- illuminate/support: ^11.0||^12.0
- liberu-genealogy/php-gedcom: ^3.2.1
Requires (Dev)
- driftingly/rector-laravel: ^1.2.0
- laravel/framework: ^10.0||^11.0||^12.0
- phpunit/phpunit: ^10.0||^11.0||^12.0
- rector/rector: ^1.0.0
- dev-main
- v7.0.0
- v6.6.4
- v6.6.3
- v6.6.2
- v6.6.1
- v6.6.0
- v6.5.1
- v6.5.0
- v6.4.1
- v6.4.0
- v6.3.1
- v6.3.0
- v6.2.3
- v6.2.1
- v6.2.0
- v6.0.0
- v5.0.0
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.0
- v3.4.16
- v3.4.15
- v3.4.14
- v3.4.13
- v3.4.12
- v3.4.11
- v3.4.10
- v3.4.9
- v3.4.8
- v3.4.7
- v3.4.6
- v3.4.5
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.1
- v3.3.0
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.9
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.3.21
- v2.3.20
- v2.3.19
- v2.3.18
- v2.3.17
- v2.3.16
- v2.3.15
- v2.3.14
- v2.3.13
- v2.3.12
- v2.3.11
- v2.3.10
- v2.3.9
- v2.3.8
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.4
- v1.1.3
- v1.1.0
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.2
- v1.0.1
- v1.0.0
- dev-sweep/Implement-GEDCOM-Export-Functionality-and-Service-Provider
- dev-sweep/Improve-Code-Organization-and-Documentation-in-GEDCOM-Processing
- dev-sweep/Optimize-Memory-Usage-in-GEDCOM-Processing
- dev-sweep/Refactor-and-Modernize-GEDCOM-Parsing-and-Processing-Utilities
- dev-sweep/Refactor-and-Modernize-GEDCOM-Parsing-and-Processing-Utilities_e7a34
- dev-sweep/Refactor-GEDCOM-Parser-and-Related-Utilities-with-Type-Safety-and-Readonly-Classes
- dev-sweep/Enhance-GEDCOM-Import/Export-Functionality-and-Testing-Infrastructure
- dev-sweep/Enhance-MediaParserTest-with-RefreshDatabase-and-Improved-Test-Setup
- dev-sweep/Enhance-GEDCOM-Parser-Test-Suite-with-Comprehensive-Test-Coverage
- dev-sweep/Enhance-GedcomParser-Test-Coverage-and-Error-Handling
- dev-sweep/Enhance-GedcomParserTest-with-Additional-Imports-and-Test-Setup
- dev-sweep/Enhance-GEDCOM-Parser-Test-Coverage-and-Error-Handling
- dev-sweep/Enhance-GedcomExporter-Test-Suite-and-Add-Traits
- dev-sweep/Enhance-GedcomExporter-Test-Suite-and-Improve-Test-Coverage
- dev-sweep/Enhance-Test-Suite-for-Laravel-GEDCOM-Package-with-Improved-Testing-Approach
- dev-sweep/Refactor-GEDCOM-Parser-and-Date-Parsing-with-PHP-8-4-Support
- dev-sweep/Enhance-GEDCOM-Parser-and-Date-Parsing-Unit-Tests
- dev-sweep/Enhance-Type-Safety-and-Compatibility-in-Laravel-GEDCOM-Parser
- dev-sweep/Improve-GedcomParser-registration-and-add-GedcomImporter-command
- dev-sweep/Add-unit-test-for-GEDCOM-export-error-handling
- dev-sweep/Upgrade-PHPUnit-to-use-TestCase-instead-of-PHPUnit-Framework-TestCase
- dev-sweep/Improve-GedcomExporterTest-unit-test
- dev-sweep/improve_codebase_for_modularization_and
- dev-sweep/add-tests-for-gedcom-exporter-helpers
- dev-sweep/add-function-docstrings
- dev-sweep/laravel_11
- dev-sweep/refactor-test-functions
- dev-sweep/refactor-gedcom-exporter
- dev-sweep/write_full_tests_a0726
- dev-sweep/write_full_tests
- dev-sweep/add-unit-tests-for-gedcom-classes
- dev-sweep/refactor-functions
- dev-sweep/refactor_codebase_to_use_php_83_and_lara
- dev-bugfix/psr-4-warnings
- dev-master
This package is auto-updated.
Last update: 2025-09-07 17:35:20 UTC
README
liberu-genealogy/laravel-gedcom is a package to parse GEDCOM files, and import them as Laravel models, inside your Laravel application. It is used by: (https://github.com/liberu-genealogy/genealogy-laravel)
- laravel-gedcom 5.0+ requires PHP 8.3 (or later).
- laravel-gedcom 6.0+ requires PHP 8.4 (or later).
- laravel-gedcom 7.0+ requires PHP 8.4 (or later). Includes GEDCOM X
Installation
composer require liberu-genealogy/laravel-gedcom
Usage
You must create the database schema before doing anything, so run the migrations:
php artisan migrate
GEDCOM Files
via Command Line
php artisan gedcom:import /path/to/your/gedcom/file.ged
via Facade
use FamilyTree365\LaravelGedcom\Facades\GedcomParserFacade;
$filename = '/path/to/your/gedcom/file.ged';
GedcomParserFacade::parse($filename, true);
via Instantiation
use \FamilyTree365\LaravelGedcom\Utils\GedcomParser;
$filename = '/path/to/your/gedcom/file.ged';
$parser = new GedcomParser();
$parser->parse($filename, true);
GedcomX Files
via Command Line
php artisan gedcomx:import /path/to/your/gedcomx/file.json --progress
via Facade
use FamilyTree365\LaravelGedcom\Facades\GedcomXParserFacade;
$filename = '/path/to/your/gedcomx/file.json';
GedcomXParserFacade::parse('mysql', $filename, 'import-slug', true);
via Instantiation
use \FamilyTree365\LaravelGedcom\Utils\GedcomXParser;
$filename = '/path/to/your/gedcomx/file.json';
$parser = new GedcomXParser();
$parser->parse('mysql', $filename, 'import-slug', true);
Checking if a file is GedcomX
use \FamilyTree365\LaravelGedcom\Utils\GedcomXParser;
$filename = '/path/to/your/file.json';
if (GedcomXParser::isGedcomXFile($filename)) {
// Process as GedcomX file
} else {
// Process as regular GEDCOM file
}
High-Performance GedcomX (PHP 8.4+ Optimized)
For maximum performance with large GedcomX files, use the optimized parser that leverages PHP 8.4 features:
via Optimized Command Line
php artisan gedcomx:import-optimized /path/to/your/gedcomx/file.json --progress --memory-limit=1024 --chunk-size=2000
via Optimized Instantiation
use \FamilyTree365\LaravelGedcom\Utils\GedcomXParserOptimized;
$filename = '/path/to/your/gedcomx/file.json';
$parser = new GedcomXParserOptimized();
$parser->parse('mysql', $filename, 'import-slug', true);
Performance Features (PHP 8.4+)
- 🚀 Up to 3x faster processing using modern PHP features
- 💾 50% less memory usage with optimized data structures
- 📦 Intelligent batch processing with automatic chunk sizing
- 🔄 Garbage collection optimization for large datasets
- âš¡ Match expressions for faster conditional logic
- 🎯 Typed constants for better performance
- 📊 Real-time performance metrics during import
Performance Comparison
Feature | Standard Parser | Optimized Parser (PHP 8.4) |
---|---|---|
Processing Speed | 1x | 3x faster |
Memory Usage | 100% | 50% less |
Batch Processing | Fixed 500 | Dynamic 1000-5000 |
Error Handling | Basic | Advanced with metrics |
PHP Version | 8.3+ | 8.4+ only |
Documentation
Database
This package will create the database tables, which map to models.
parse()
Method
The parse()
method takes three parameters, string $filename
, bool $progressBar = false
and string $conn
If you set $progressBar
to true, a ProgressBar will be output to php://stdout
, which is useful when you are calling
the parser from Artisan commands.
Contributing
Pull requests are welcome, as are issues. Feel free to submit any feedback too.
Contributors
License
MIT License (see License.md). This means you must retain the copyright and permission notice is all copies, or substantial portions of this software.