Initial Ladill Hosting app with Gitea deploy pipeline.
Deploy Ladill Hosting / deploy (push) Failing after 17s
Deploy Ladill Hosting / deploy (push) Failing after 17s
Shared web hosting extracted from the platform monolith, with CI deploy to /var/www/ladill-hosting matching Bird/Domains/Email. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class HostedSite extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'hosting_account_id',
|
||||
'domain_id',
|
||||
'domain',
|
||||
'document_root',
|
||||
'type',
|
||||
'status',
|
||||
'php_version',
|
||||
'ssl_enabled',
|
||||
'ssl_status',
|
||||
'ssl_error',
|
||||
'ssl_expires_at',
|
||||
'ssl_provisioned_at',
|
||||
'installed_app',
|
||||
'installed_app_version',
|
||||
'app_config',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'ssl_enabled' => 'boolean',
|
||||
'ssl_expires_at' => 'datetime',
|
||||
'ssl_provisioned_at' => 'datetime',
|
||||
'app_config' => 'array',
|
||||
];
|
||||
|
||||
public function account(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(HostingAccount::class, 'hosting_account_id');
|
||||
}
|
||||
|
||||
public function domain(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Domain::class);
|
||||
}
|
||||
|
||||
public function databases(): HasMany
|
||||
{
|
||||
return $this->hasMany(HostedDatabase::class);
|
||||
}
|
||||
|
||||
public function appInstallation(): HasOne
|
||||
{
|
||||
return $this->hasOne(AppInstallation::class)->where('status', 'active')->latestOfMany();
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('status', 'active');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user