Implement ticket details and worklog editing
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\TicketFieldValueFactory;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable([
|
||||
'ticket_field_definition_id',
|
||||
'ticket_id',
|
||||
'value_number',
|
||||
'value_user_id',
|
||||
])]
|
||||
class TicketFieldValue extends Model
|
||||
{
|
||||
/** @use HasFactory<TicketFieldValueFactory> */
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'value_number' => 'float',
|
||||
];
|
||||
}
|
||||
|
||||
public function ticket(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Ticket::class);
|
||||
}
|
||||
|
||||
public function ticketFieldDefinition(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TicketFieldDefinition::class);
|
||||
}
|
||||
|
||||
public function userValue(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'value_user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user