From: Vincent Vanwaelscappel Date: Tue, 22 Oct 2019 09:37:36 +0000 (+0200) Subject: wip #3158 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ef52ed86b4d741bf3eb2e5922b09e1a7852528c2;p=cubist_cms-back.git wip #3158 @0.5 --- diff --git a/src/app/Console/Commands/LocaleCopy.php b/src/app/Console/Commands/LocaleCopy.php index 6962ab8..b7e90e2 100644 --- a/src/app/Console/Commands/LocaleCopy.php +++ b/src/app/Console/Commands/LocaleCopy.php @@ -2,9 +2,41 @@ namespace Cubist\Backpack\app\Console\Commands; -use Illuminate\Console\Command; -class LocaleCopy extends Command + +use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel; + +class LocaleCopy extends CubistCommand { + /** + * The name and signature of the console command. + * + * @var string + */ + protected $signature = 'cubist:locale:copy {from} {to}'; + + /** + * The console command description. + * + * @var string + */ + protected $description = 'Copy locale to another one. Useful to start the translation of a website.'; + + public function handle() + { + $from = $this->argument('from'); + $to = $this->argument('to'); + + $this->call('backup:run'); + + $this->_handleMagicFolder([$this, '_copyModel']); + } + /** + * @param $model CubistMagicAbstractModel + */ + protected function _copyModel($model) + { + echo 'Copy locale of model ' . $model; + } }