coolify/app/Models/CloudInitScript.php
Andras Bacsai e200d881f5 feat(security): add editable cloud credential pages
Add dedicated show/edit pages for cloud provider tokens and cloud-init
scripts, including descriptions and UUID routes.

Generate private keys directly from the index and surface cloud provider
API loading errors in server creation flows.
2026-07-08 12:58:27 +02:00

35 lines
638 B
PHP

<?php
namespace App\Models;
class CloudInitScript extends BaseModel
{
protected $fillable = [
'team_id',
'name',
'script',
];
protected $hidden = [
'script',
];
protected function casts(): array
{
return [
'script' => 'encrypted',
];
}
public function team()
{
return $this->belongsTo(Team::class);
}
public static function ownedByCurrentTeam(array $select = ['*'])
{
$selectArray = collect($select)->concat(['id']);
return self::whereTeamId(currentTeam()->id)->select($selectArray->all());
}
}