FEATURE: add fields for languages
This commit is contained in:
@@ -12,7 +12,7 @@ class AddLanguage extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'language:add {code} {translation}';
|
||||
protected $signature = 'language:add {code} {translation} {native} {script?}';
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
@@ -39,6 +39,8 @@ class AddLanguage extends Command
|
||||
{
|
||||
$code = $this->argument('code');
|
||||
$translation = $this->argument('translation');
|
||||
$native = $this->argument('native');
|
||||
$script = $this->argument('script');
|
||||
|
||||
// check if language does not exist
|
||||
$exist = Language::find($code);
|
||||
@@ -48,7 +50,12 @@ class AddLanguage extends Command
|
||||
return;
|
||||
}
|
||||
|
||||
Language::create(['code' => $code, 'name' => $translation]);
|
||||
Language::create([
|
||||
'code' => $code,
|
||||
'name' => $translation,
|
||||
'native' => $native,
|
||||
'script' => $script ? $script : 'Latn'
|
||||
]);
|
||||
|
||||
$this->line('Successfully installed.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user