mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 00:34:35 -04:00
Add documents to groups
This commit is contained in:
parent
d4bfca46bc
commit
81da8e169d
@ -22,6 +22,7 @@ use App\Models\GroupSetting;
|
|||||||
use App\Repositories\GroupSettingRepository;
|
use App\Repositories\GroupSettingRepository;
|
||||||
use App\Transformers\GroupSettingTransformer;
|
use App\Transformers\GroupSettingTransformer;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
use App\Utils\Traits\Uploadable;
|
use App\Utils\Traits\Uploadable;
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -32,6 +33,7 @@ class GroupSettingController extends BaseController
|
|||||||
use DispatchesJobs;
|
use DispatchesJobs;
|
||||||
use Uploadable;
|
use Uploadable;
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
use SavesDocuments;
|
||||||
|
|
||||||
protected $entity_type = GroupSetting::class;
|
protected $entity_type = GroupSetting::class;
|
||||||
|
|
||||||
@ -357,6 +359,9 @@ class GroupSettingController extends BaseController
|
|||||||
|
|
||||||
$this->uploadLogo($request->file('company_logo'), $group_setting->company, $group_setting);
|
$this->uploadLogo($request->file('company_logo'), $group_setting->company, $group_setting);
|
||||||
|
|
||||||
|
if ($request->has('documents'))
|
||||||
|
$this->saveDocuments($request->input('documents'), $group_setting, false);
|
||||||
|
|
||||||
return $this->itemResponse($group_setting);
|
return $this->itemResponse($group_setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,11 @@ class GroupSetting extends StaticModel
|
|||||||
return $this->hasMany(Client::class, 'id', 'group_settings_id');
|
return $this->hasMany(Client::class, 'id', 'group_settings_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function documents()
|
||||||
|
{
|
||||||
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the model for a bound value.
|
* Retrieve the model for a bound value.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user