2023-05-30 15:52:17 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
class ApplicationPreview extends BaseModel
|
|
|
|
{
|
|
|
|
protected $fillable = [
|
|
|
|
'uuid',
|
|
|
|
'pull_request_id',
|
2023-05-31 10:19:29 +02:00
|
|
|
'pull_request_html_url',
|
2023-06-13 15:01:11 +02:00
|
|
|
'pull_request_issue_comment_id',
|
2023-05-30 15:52:17 +02:00
|
|
|
'fqdn',
|
|
|
|
'status',
|
|
|
|
'application_id',
|
|
|
|
];
|
2023-08-08 11:51:36 +02:00
|
|
|
|
2023-05-30 15:52:17 +02:00
|
|
|
static function findPreviewByApplicationAndPullId(int $application_id, int $pull_request_id)
|
|
|
|
{
|
|
|
|
return self::where('application_id', $application_id)->where('pull_request_id', $pull_request_id)->firstOrFail();
|
|
|
|
}
|
2023-08-08 11:51:36 +02:00
|
|
|
|
|
|
|
public function application()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Application::class);
|
|
|
|
}
|
2023-05-30 15:52:17 +02:00
|
|
|
}
|