60 lines
1.8 KiB
PHP
60 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property string $title Gitlab issue title
|
|
* @property string $url Gitlab URL
|
|
* @property int $estimate_time Gitlab issue estimate time in seconds
|
|
* @property int $spent_time Gitlab issue spent time in seconds
|
|
* @property int $is_closed Gitlab issue status
|
|
* @property int $gitlab_id Gitlab issue id
|
|
* @property int $gitlab_iid Gitlab issue iid in project
|
|
* @property int|null $milestone_iid Gitlab issue linked milestone iid in project
|
|
* @property int $gitlab_project_id Gitlab project id
|
|
* @property string $g_created_at Gitlab issue created at
|
|
* @property string $g_updated_at Gitlab issue updated at
|
|
* @property string|null $g_closed_at Gitlab issue closed at
|
|
* @property string|null $g_due_date Gitlab issue due date
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\GitlabLabels> $gitlabLabels
|
|
* @mixin \Eloquent
|
|
*/
|
|
class GitlabIssues extends Model
|
|
{
|
|
/**
|
|
* Fillable array model
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'title',
|
|
'url',
|
|
'estimate_time',
|
|
'spent_time',
|
|
'is_closed',
|
|
'gitlab_id',
|
|
'gitlab_iid',
|
|
'milestone_iid',
|
|
'gitlab_project_id',
|
|
'g_created_at',
|
|
'g_updated_at',
|
|
'g_closed_at',
|
|
'g_due_date'
|
|
];
|
|
|
|
/**
|
|
* Gitlab Labels relationship
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
|
*/
|
|
public function gitlabLabels()
|
|
{
|
|
return $this->belongsToMany(GitlabLabels::class, 'gitlab_issues_labels', 'issue_id', 'label_id')
|
|
->withTimestamps();
|
|
}
|
|
}
|