Files
coolify/app/Models/IntegrationToken.php
T
Andras Bacsai 743f54b317 feat(security): add Cloudflare integration token management
Add encrypted team-scoped integration token storage, admin UI, authorization, and Cloudflare token validation.
2026-08-18 16:15:34 +02:00

39 lines
691 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class IntegrationToken extends BaseModel
{
protected $fillable = [
'team_id',
'provider',
'name',
'token',
'capabilities',
];
protected $hidden = [
'token',
];
protected function casts(): array
{
return [
'token' => 'encrypted',
'capabilities' => 'array',
];
}
public function team(): BelongsTo
{
return $this->belongsTo(Team::class);
}
public static function ownedByCurrentTeam()
{
return self::query()->where('team_id', currentTeam()->id);
}
}