mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 10:51:36 +00:00
* feat(redirects): add redirects to sites * chore(style): fixed coding style issues * style: fix php-stan docblocks * style: pint cleanup * tests: fixed redirect test suite * feat: vhosts include additional configs * fix: use exact location matching * - add enums - use queues - use vhost rather than separate conf files - vhost formatter - cleanup * generate docs --------- Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
50 lines
1.0 KiB
PHP
50 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\RedirectStatus;
|
|
use Database\Factories\RedirectFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $site_id
|
|
* @property string $from
|
|
* @property string $to
|
|
* @property string $mode
|
|
* @property string $status
|
|
* @property Site $site
|
|
*/
|
|
class Redirect extends AbstractModel
|
|
{
|
|
/** @use HasFactory<RedirectFactory> */
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'site_id',
|
|
'from',
|
|
'to',
|
|
'mode',
|
|
'status',
|
|
];
|
|
|
|
/**
|
|
* @var array<string, string>
|
|
*/
|
|
public static array $statusColors = [
|
|
RedirectStatus::CREATING => 'warning',
|
|
RedirectStatus::READY => 'success',
|
|
RedirectStatus::DELETING => 'warning',
|
|
RedirectStatus::FAILED => 'danger',
|
|
];
|
|
|
|
/**
|
|
* @return BelongsTo<Site, covariant $this>
|
|
*/
|
|
public function site(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Site::class);
|
|
}
|
|
}
|