Skip to content

Package to parse GEDCOM files, and import them into Laravel

License

Notifications You must be signed in to change notification settings

agjmills/laravel-gedcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GEDCOM to Laravel Model

asdfx/laravel-gedcom is a package to parse GEDCOM files, and import them as Laravel models, inside your Laravel application.

Installation

composer require asdfx/laravel-gedcom

Usage

You must create the database schema before doing anything, so run the migrations:

php artisan migrate

via Command Line

php artisan gedcom:import /path/to/your/gedcom/file.ged

via Facade

use Asdfx\LaravelGedcom\Facades\GedcomParserFacade;
$filename = '/path/to/your/gedcom/file.ged';
GedcomParserFacade::parse($filename, true);

via Instantiation

use \Asdfx\LaravelGedcom\Utils\GedcomParser;
$filename = '/path/to/your/gedcom/file.ged';
$parser = new GedcomParser();
$parser->parse($filename, true);

Documentation

Database

This package will create the following database tables, which map to models:

  • places -> Asdfx\LaravelGedcom\Models\Place
  • persons -> Asdfx\LaravelGedcom\Models\Person
  • person_events -> Asdfx\LaravelGedcom\Models\PersonEvent
  • families Asdfx\LaravelGedcom\Models\Family
  • family_events Asdfx\LaravelGedcom\Models\FamilyEvents

parse() Method

The parse() method takes two parameters, string $filename, and bool $progressBar = false. 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.

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.

About

Package to parse GEDCOM files, and import them into Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages