32 lines
825 B
PHP
32 lines
825 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\TicketLinkFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable(['source_ticket_id', 'target_ticket_id', 'ticket_link_type_id'])]
|
|
class TicketLink extends Model
|
|
{
|
|
/** @use HasFactory<TicketLinkFactory> */
|
|
use HasFactory;
|
|
|
|
public function sourceTicket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ticket::class, 'source_ticket_id');
|
|
}
|
|
|
|
public function targetTicket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ticket::class, 'target_ticket_id');
|
|
}
|
|
|
|
public function ticketLinkType(): BelongsTo
|
|
{
|
|
return $this->belongsTo(TicketLinkType::class);
|
|
}
|
|
}
|