huge Laravel 10 upgrade

This commit is contained in:
HolgerHatGarKeineNode
2023-02-19 20:13:20 +01:00
parent 5c74f77beb
commit 12847f95f6
440 changed files with 46336 additions and 682 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace JoeDixon\Translation\Console\Commands;
class AddLanguageCommand extends BaseCommand
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'translation:add-language';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Add a new language to the application';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
// ask the user for the language they wish to add
$language = $this->ask(__('translation::translation.prompt_language'));
$name = $this->ask(__('translation::translation.prompt_name'));
// attempt to add the key and fail gracefully if exception thrown
try {
$this->translation->addLanguage($language, $name);
$this->info(__('translation::translation.language_added'));
} catch (\Exception $e) {
$this->error($e->getMessage());
}
}
}