<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Team extends Model
{
    use HasFactory, HasDateTimeFormatter, SoftDeletes;

    protected $hidden = [
        'updated_at',
        'deleted_at'
    ];

    public function users()
    {
        return $this->belongsToMany(User::class, 'team_users', 'team_id', 'game_id');
    }

    public function creator_s()
    {
        return $this->belongsTo(User::class, 'creator', 'id');
    }

}
