mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
* resolve issue with EOL * Manual Run * reverse change for manual run of tests * remove logging
42 lines
817 B
PHP
42 lines
817 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int $site_id
|
|
* @property string $name
|
|
* @property string $content
|
|
* @property Site $site
|
|
*/
|
|
class DeploymentScript extends AbstractModel
|
|
{
|
|
use HasFactory;
|
|
|
|
protected static function boot(): void
|
|
{
|
|
parent::boot();
|
|
|
|
static::saving(function ($deploymentScript) {
|
|
$deploymentScript->content = str_replace("\r\n", "\n", $deploymentScript->content);
|
|
});
|
|
}
|
|
|
|
protected $fillable = [
|
|
'site_id',
|
|
'name',
|
|
'content',
|
|
];
|
|
|
|
protected $casts = [
|
|
'site_id' => 'integer',
|
|
];
|
|
|
|
public function site(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Site::class);
|
|
}
|
|
}
|