multilines wip
This commit is contained in:
1 parent
218c1e6e1c
commit
825a8d430c
19 files changed
+145
-78
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user