mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 06:24:35 -04:00
Group Document defaults
This commit is contained in:
parent
cfbf6e8f4e
commit
cfc144b6ec
@ -75,7 +75,7 @@ class BaseController extends Controller
|
|||||||
'company.credits.invitations.company',
|
'company.credits.invitations.company',
|
||||||
'company.credits.documents',
|
'company.credits.documents',
|
||||||
'company.expenses.documents',
|
'company.expenses.documents',
|
||||||
'company.groups',
|
'company.groups.documents',
|
||||||
'company.invoices.invitations.contact',
|
'company.invoices.invitations.contact',
|
||||||
'company.invoices.invitations.company',
|
'company.invoices.invitations.company',
|
||||||
'company.invoices.documents',
|
'company.invoices.documents',
|
||||||
|
@ -73,6 +73,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
'id_number',
|
'id_number',
|
||||||
'group_settings_id',
|
'group_settings_id',
|
||||||
'public_notes',
|
'public_notes',
|
||||||
|
'phone'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $with = [
|
protected $with = [
|
||||||
|
@ -11,7 +11,9 @@
|
|||||||
|
|
||||||
namespace App\Transformers;
|
namespace App\Transformers;
|
||||||
|
|
||||||
|
use App\Models\Document;
|
||||||
use App\Models\GroupSetting;
|
use App\Models\GroupSetting;
|
||||||
|
use App\Transformers\DocumentTransformer;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
@ -23,6 +25,7 @@ class GroupSettingTransformer extends EntityTransformer
|
|||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
|
||||||
protected $defaultIncludes = [
|
protected $defaultIncludes = [
|
||||||
|
'documents'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,4 +50,12 @@ class GroupSettingTransformer extends EntityTransformer
|
|||||||
'is_deleted' => (bool) $group_setting->is_deleted,
|
'is_deleted' => (bool) $group_setting->is_deleted,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function includeDocuments(GroupSetting $group_setting)
|
||||||
|
{
|
||||||
|
$transformer = new DocumentTransformer($this->serializer);
|
||||||
|
|
||||||
|
return $this->includeCollection($group_setting->documents, $transformer, Document::class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user