Implement ticket links and blocker state
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user