diff --git a/src/Commands/GedcomImporter.php b/src/Commands/GedcomImporter.php index 59a7a10..d58f1da 100644 --- a/src/Commands/GedcomImporter.php +++ b/src/Commands/GedcomImporter.php @@ -2,7 +2,7 @@ namespace Asdfx\LaravelGedcom\Commands; -use Asdfx\LaravelGedcom\Utils\GedcomParser; +use Asdfx\LaravelGedcom\Facades\GedcomParserFacade; use Illuminate\Console\Command; class GedcomImporter extends Command @@ -39,7 +39,6 @@ public function __construct() public function handle() { $filename = $this->argument('filename'); - $parser = new GedcomParser(); - $parser->parse($filename, true); + GedcomParserFacade::parse($filename, true); } } diff --git a/src/Facades/GedcomParserFacade.php b/src/Facades/GedcomParserFacade.php new file mode 100644 index 0000000..0f5c7f6 --- /dev/null +++ b/src/Facades/GedcomParserFacade.php @@ -0,0 +1,13 @@ +commands([ GedcomImporter::class ]); + + $this->app->bind('asdfx/laravel-gedcom:parser', function () { + return new GedcomParser(); + }); } public function boot()