Add Compoships for multile key relationships, first implemented with Service::class

This commit is contained in:
Deon George
2022-09-29 17:26:03 +10:00
parent 2a19f14adb
commit ec99a5ff75
10 changed files with 99 additions and 43 deletions

View File

@@ -15,6 +15,7 @@ use Leenooks\Traits\ScopeActive;
use Leenooks\Traits\UserSwitch;
use App\Interfaces\IDs;
use App\Models\Scopes\SiteScope;
use App\Notifications\ResetPassword as ResetPasswordNotification;
use App\Traits\{QueryCacheableConfig,SiteID};
@@ -412,6 +413,7 @@ class User extends Authenticatable implements IDs
->groupBy(['invoice_id']);
$summary = (new Invoice)
->withoutGlobalScope(SiteScope::class)
->select([
'invoice_id',
DB::raw('SUM(discount) AS discount'),