fixed install/update locale
This commit is contained in:
@ -19,7 +19,7 @@ class CompanySeed extends Command
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Seed for specific company';
|
||||
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Events\Install\UpdateFinished;
|
||||
use App\Models\Common\Company;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class FinishUpdate extends Command
|
||||
@ -12,7 +13,7 @@ class FinishUpdate extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'update:finish {alias} {company_id} {new} {old}';
|
||||
protected $signature = 'update:finish {alias} {company} {new} {old}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@ -43,7 +44,7 @@ class FinishUpdate extends Command
|
||||
$this->call('cache:clear');
|
||||
|
||||
$alias = $this->argument('alias');
|
||||
$company_id = $this->argument('company_id');
|
||||
$company_id = $this->argument('company');
|
||||
$new = $this->argument('new');
|
||||
$old = $this->argument('old');
|
||||
|
||||
@ -53,6 +54,11 @@ class FinishUpdate extends Command
|
||||
throw new \Exception(trans('modules.errors.finish', ['module' => $alias]));
|
||||
}
|
||||
|
||||
// Set locale for modules
|
||||
if ($alias != 'core') {
|
||||
app()->setLocale(Company::find($company_id)->locale);
|
||||
}
|
||||
|
||||
session(['company_id' => $company_id]);
|
||||
setting()->setExtraColumns(['company_id' => $company_id]);
|
||||
|
||||
|
@ -27,7 +27,7 @@ class Install extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'install
|
||||
protected $signature = 'install
|
||||
{--db-host=localhost : Database host}
|
||||
{--db-port=3306 : Port of the database host}
|
||||
{--db-name= : Name of the database}
|
||||
@ -64,6 +64,7 @@ class Install extends Command
|
||||
|
||||
$this->line('Setting locale ' . $this->locale);
|
||||
Session::put(self::OPT_LOCALE, $this->locale);
|
||||
app()->setLocale($this->locale);
|
||||
|
||||
$this->prompt();
|
||||
|
||||
|
@ -23,7 +23,7 @@ class Update extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'update {alias} {company_id} {new=latest}';
|
||||
protected $signature = 'update {alias} {company} {new=latest}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@ -31,7 +31,7 @@ class Update extends Command
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Allows to update Akaunting and modules directly through CLI';
|
||||
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
@ -55,8 +55,8 @@ class Update extends Command
|
||||
|
||||
$this->old = $this->getOldVersion();
|
||||
|
||||
session(['company_id' => $this->argument('company_id')]);
|
||||
setting()->setExtraColumns(['company_id' => $this->argument('company_id')]);
|
||||
session(['company_id' => $this->argument('company')]);
|
||||
setting()->setExtraColumns(['company_id' => $this->argument('company')]);
|
||||
|
||||
if (!$path = $this->download()) {
|
||||
return self::CMD_ERROR;
|
||||
|
@ -19,7 +19,7 @@ class UserSeed extends Command
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Seed for specific user';
|
||||
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
|
Reference in New Issue
Block a user