lasthourcloud/app/Models/PrivateKey.php
Andras Bacsai 0123ae97a1 fixes
2023-06-16 13:13:09 +02:00

25 lines
531 B
PHP

<?php
namespace App\Models;
class PrivateKey extends BaseModel
{
protected $fillable = [
'name',
'description',
'private_key',
'team_id',
];
static public function ownedByCurrentTeam(array $select = ['*'])
{
$selectArray = collect($select)->concat(['id']);
return PrivateKey::whereTeamId(session('currentTeam')->id)->where('id', '>', 0)->select($selectArray->all());
}
public function servers()
{
return $this->hasMany(Server::class);
}
}