lasthourcloud/app/Models/PrivateKey.php

25 lines
531 B
PHP
Raw Normal View History

<?php
namespace App\Models;
2023-06-07 13:08:35 +00:00
class PrivateKey extends BaseModel
{
protected $fillable = [
'name',
'description',
'private_key',
'team_id',
];
2023-06-16 10:05:52 +00:00
static public function ownedByCurrentTeam(array $select = ['*'])
2023-06-07 13:08:35 +00:00
{
2023-06-16 10:05:52 +00:00
$selectArray = collect($select)->concat(['id']);
return PrivateKey::whereTeamId(session('currentTeam')->id)->where('id', '>', 0)->select($selectArray->all());
2023-06-07 13:08:35 +00:00
}
2023-06-16 10:05:52 +00:00
public function servers()
{
2023-03-27 12:31:42 +00:00
return $this->hasMany(Server::class);
}
}