Jenkins file
Laverie/backend/pipeline/head There was a failure building this commit

This commit is contained in:
bastien
2026-07-04 22:42:58 +02:00
parent 10ee859602
commit d95bfa6c58
244 changed files with 16 additions and 15 deletions
@@ -0,0 +1,18 @@
<?php
namespace App\Models\Concerns;
use App\Models\Organization;
use Illuminate\Database\Eloquent\Builder;
trait BelongsToOrganization
{
public function scopeForOrganization(Builder $query, Organization|int $organization): Builder
{
$organizationId = $organization instanceof Organization ? $organization->id : $organization;
return $query->whereHas('establishment', function (Builder $query) use ($organizationId) {
$query->where('organization_id', $organizationId);
});
}
}