multilines wip

This commit is contained in:
salam committed 2025-12-13 09:57:15 +01:00
1 parent 218c1e6e1c
commit 825a8d430c
19 files changed
+145 -78

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Models\Scopes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
class ClientScope implements Scope
{
/**
* Apply the scope to a given Eloquent query builder.
*/
public function apply(Builder $builder, Model $model): void
{
if (auth()->hasUser()) {
$builder->where('client_id', auth()->user()->client_id);
}
}
}