Files
laravel-data-sync/src/Console/Commands/Sync.php
2019-01-24 17:27:30 -05:00

26 lines
585 B
PHP

<?php
namespace distinctm\LaravelDataSync\Console\Commands;
use distinctm\LaravelDataSync\Updater;
use Illuminate\Console\Command;
class Sync extends Command
{
protected $signature = 'data:sync {--path=} {--model=}';
protected $description = 'Update Models with respective sync data files';
public function handle()
{
$path = $this->option('path');
$model = $this->option('model');
$this->info('Updating Models with sync data files');
(new Updater($path, $model))->run();
$this->comment('Data sync completed');
}
}