settings install for add new company
This commit is contained in:
parent
8773df6177
commit
9466551f0f
30
.env.example
30
.env.example
@ -1,30 +0,0 @@
|
||||
APP_NAME=Akaunting
|
||||
APP_ENV=production
|
||||
APP_LOCALE=en-GB
|
||||
APP_INSTALLED=false
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_SCHEDULE_TIME="09:00"
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=localhost
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=
|
||||
DB_USERNAME=
|
||||
DB_PASSWORD=
|
||||
DB_PREFIX=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=database
|
||||
|
||||
MAIL_DRIVER=mail
|
||||
MAIL_HOST=localhost
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_NAME=null
|
||||
MAIL_FROM_ADDRESS=null
|
@ -65,10 +65,7 @@ class Companies extends Controller
|
||||
|
||||
// Create company
|
||||
$company = Company::create($request->input());
|
||||
|
||||
setting()->forgetAll();
|
||||
setting()->setExtraColumns(['company_id' => $company->id]);
|
||||
|
||||
|
||||
// Create settings
|
||||
setting()->set('general.company_name', $request->get('company_name'));
|
||||
setting()->set('general.company_email', $request->get('company_email'));
|
||||
@ -223,6 +220,8 @@ class Companies extends Controller
|
||||
if (!$this->isUserCompany($company)) {
|
||||
$message = trans('companies.error.not_user_company');
|
||||
|
||||
Overrider::load('settings');
|
||||
|
||||
flash($message)->error();
|
||||
|
||||
return redirect()->route('companies.index');
|
||||
@ -278,6 +277,8 @@ class Companies extends Controller
|
||||
if ($this->isUserCompany($company)) {
|
||||
session(['company_id' => $company->id]);
|
||||
|
||||
Overrider::load('settings');
|
||||
|
||||
event(new CompanySwitched($company));
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ class Settings extends Seeder
|
||||
{
|
||||
$company_id = $this->command->argument('company');
|
||||
|
||||
setting()->forgetAll();
|
||||
setting()->setExtraColumns(['company_id' => $company_id]);
|
||||
|
||||
setting()->set([
|
||||
|
Loading…
x
Reference in New Issue
Block a user