mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01: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\Transformers\GroupSettingTransformer;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\SavesDocuments;
|
||||
use App\Utils\Traits\Uploadable;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Http\Request;
|
||||
@ -32,6 +33,7 @@ class GroupSettingController extends BaseController
|
||||
use DispatchesJobs;
|
||||
use Uploadable;
|
||||
use MakesHash;
|
||||
use SavesDocuments;
|
||||
|
||||
protected $entity_type = GroupSetting::class;
|
||||
|
||||
@ -357,6 +359,9 @@ class GroupSettingController extends BaseController
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,11 @@ class GroupSetting extends StaticModel
|
||||
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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user