2025-10-10 17:37:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2026-07-08 10:58:27 +00:00
|
|
|
class CloudInitScript extends BaseModel
|
2025-10-10 17:37:16 +00:00
|
|
|
{
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'team_id',
|
|
|
|
|
'name',
|
|
|
|
|
'script',
|
|
|
|
|
];
|
|
|
|
|
|
2026-05-11 19:18:07 +00:00
|
|
|
protected $hidden = [
|
|
|
|
|
'script',
|
|
|
|
|
];
|
|
|
|
|
|
2025-10-10 17:37:16 +00:00
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|