first commit

This commit is contained in:
Ariyutta
2026-08-07 10:47:09 +07:00
commit 1c094fbe7f
11630 changed files with 1580900 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Models\Verifikator;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TeamUser extends Model
{
use HasFactory;
protected $table = 'verifikator.team_users';
protected $fillable = ['team_id', 'user_id', 'active'];
function team()
{
return $this->belongsTo(Team::class);
}
function user()
{
return $this->belongsTo(User::class);
}
function scopeActive($query)
{
return $query->where('active', 1);
}
protected static function boot()
{
parent::boot();
static::updating(function ($model) {
if ($model->active == 1) {
TeamUser::where('user_id', '!=', $model->user_id)->update(['active' => 0]);
}
});
}
}