Only limit template creator scope when authenticated

This commit is contained in:
Marcus Moore 2024-01-17 11:24:38 -08:00
parent 2768f19b7c
commit 0883321d9e
No known key found for this signature in database

View file

@ -36,7 +36,9 @@ class ReportTemplate extends Model
{
// Scope to current user
static::addGlobalScope('current_user', function (Builder $builder) {
$builder->where('user_id', auth()->id());
if (auth()->check()) {
$builder->where('user_id', auth()->id());
}
});
}