lasthourcloud/app/Models/ApplicationPreview.php

24 lines
578 B
PHP
Raw Normal View History

2023-05-30 13:52:17 +00:00
<?php
namespace App\Models;
class ApplicationPreview extends BaseModel
{
protected $fillable = [
'uuid',
'pull_request_id',
2023-05-31 08:19:29 +00:00
'pull_request_html_url',
2023-05-30 13:52:17 +00:00
'fqdn',
'status',
'application_id',
];
public function application()
{
return $this->belongsTo(Application::class);
}
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();
}
}