26 خطوط
648 B
PHP
26 خطوط
648 B
PHP
<?php
|
|
|
|
namespace App\Modules\Teams\Domain;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
|
|
class Team extends Model
|
|
{
|
|
use HasUlids;
|
|
|
|
protected $fillable = ['organization_id', 'name', 'description', 'status', 'created_by'];
|
|
|
|
public function members(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(User::class, 'team_memberships')->withTimestamps();
|
|
}
|
|
|
|
public function managers(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(User::class, 'team_managers')->withTimestamps();
|
|
}
|
|
}
|