ldc-supportweb/app/Models/GitlabLabels.php

38 lines
895 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $name Label name
* @property int $gitlab_id Label Gitlab id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\GitlabIssues> $issues
* @mixin \Eloquent
*/
class GitlabLabels extends Model
{
/**
* Fillable array model
*
* @var array
*/
protected $fillable = [
'name',
'gitlab_id'
];
/**
* Gitlab Issues relationship
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function issues()
{
return $this->belongsToMany(GitlabIssues::class, 'gitlab_issues_labels', 'label_id', 'issue_id')
->withTimestamps();
}
}