improvements
This commit is contained in:
@@ -4,8 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Modules\Helpdesk\Models;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
@@ -25,6 +28,17 @@ final class Team extends Model
|
||||
'is_default' => 'boolean',
|
||||
];
|
||||
|
||||
/** @return BelongsToMany<User, Team> */
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
User::class,
|
||||
'helpdesk_team_user',
|
||||
'team_id',
|
||||
'user_id'
|
||||
)->withTimestamps();
|
||||
}
|
||||
|
||||
/** @return HasMany<Project> */
|
||||
public function projects(): HasMany
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user