1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Add documents to groups

This commit is contained in:
David Bomba 2021-01-18 22:06:26 +11:00
parent d4bfca46bc
commit 81da8e169d
2 changed files with 10 additions and 0 deletions

View File

@ -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);
}

View File

@ -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.
*