Skip to content

Commit

Permalink
settings install for add new company
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcoban committed Mar 28, 2019
1 parent 8773df6 commit 9466551
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 34 deletions.
30 changes: 0 additions & 30 deletions .env.example

This file was deleted.

9 changes: 5 additions & 4 deletions app/Http/Controllers/Common/Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ public function store(Request $request)

// 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'));
Expand Down Expand Up @@ -223,6 +220,8 @@ public function disable(Company $company)
if (!$this->isUserCompany($company)) {
$message = trans('companies.error.not_user_company');

Overrider::load('settings');

flash($message)->error();

return redirect()->route('companies.index');
Expand Down Expand Up @@ -278,6 +277,8 @@ public function set(Company $company)
if ($this->isUserCompany($company)) {
session(['company_id' => $company->id]);

Overrider::load('settings');

event(new CompanySwitched($company));
}

Expand Down
1 change: 1 addition & 0 deletions database/seeds/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private function create()
{
$company_id = $this->command->argument('company');

setting()->forgetAll();
setting()->setExtraColumns(['company_id' => $company_id]);

setting()->set([
Expand Down

0 comments on commit 9466551

Please sign in to comment.