fixed settings cache

This commit is contained in:
denisdulici 2020-01-01 00:53:47 +03:00
parent cd5341e9d3
commit 44edf993c7
3 changed files with 6 additions and 7 deletions

View File

@ -29,11 +29,12 @@ class CreateCompany extends Job
*/ */
public function handle() public function handle()
{ {
// Clear settings
setting()->forgetAll();
$this->company = Company::create($this->request->all()); $this->company = Company::create($this->request->all());
// Clear settings
setting()->setExtraColumns(['company_id' => $this->company->id]);
setting()->forgetAll();
$this->callSeeds(); $this->callSeeds();
$this->updateSettings(); $this->updateSettings();
@ -64,8 +65,6 @@ class CreateCompany extends Job
protected function updateSettings() protected function updateSettings()
{ {
setting()->setExtraColumns(['company_id' => $this->company->id]);
if ($this->request->file('logo')) { if ($this->request->file('logo')) {
$company_logo = $this->getMedia($this->request->file('logo'), 'settings', $this->company->id); $company_logo = $this->getMedia($this->request->file('logo'), 'settings', $this->company->id);

View File

@ -40,10 +40,10 @@ class UpdateCompany extends Job
$this->company->update($this->request->all()); $this->company->update($this->request->all());
// Clear current settings // Clear current settings
setting()->setExtraColumns(['company_id' => $this->company->id]);
setting()->forgetAll(); setting()->forgetAll();
// Load settings based on the given company // Load settings based on the given company
setting()->setExtraColumns(['company_id' => $this->company->id]);
setting()->load(true); setting()->load(true);
if ($this->request->has('name')) { if ($this->request->has('name')) {

View File

@ -26,8 +26,8 @@ class Accounts extends Seeder
{ {
$company_id = $this->command->argument('company'); $company_id = $this->command->argument('company');
setting()->forgetAll();
setting()->setExtraColumns(['company_id' => $company_id]); setting()->setExtraColumns(['company_id' => $company_id]);
setting()->forgetAll();
$rows = [ $rows = [
[ [