This commit is contained in:
salam committed 2025-09-10 09:49:36 +02:00
1 parent 2cb88a4290
commit ff672c3371
21 files changed
+261 -73

No files matched your search

+5 -5
View File
@@ -2,7 +2,7 @@
namespace App\Models;
// use App\Models\Scopes\KontoScope;
use App\Models\Scopes\KontoScope;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -10,9 +10,9 @@ class Gutachter extends Model
{
use SoftDeletes;
// protected static function booted(): void
// {
// static::addGlobalScope(new KontoScope);
protected static function booted(): void
{
static::addGlobalScope(new KontoScope);
// }
}
}
+3 -1
View File
@@ -13,6 +13,8 @@ class KontoScope implements Scope
*/
public function apply(Builder $builder, Model $model): void
{
$builder->where('konto_id', auth()->user()->konto_id);
if (auth()->hasUser()) {
$builder->where('konto_id', auth()->user()->konto_id);
}
}
}
+4 -4
View File
@@ -72,11 +72,11 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
];
}
// protected static function booted(): void
// {
// static::addGlobalScope(new KontoScope);
protected static function booted(): void
{
static::addGlobalScope(new KontoScope);
// }
}
public function getAppAuthenticationSecret(): ?string
{