2026-08-06 20:38:52 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class AiProvider extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
2026-08-06 21:26:56 +03:00
|
|
|
// 'youtube' isn't an AI provider, but reuses this same credentials
|
|
|
|
|
// shape: api_key holds an OAuth refresh_token, config holds
|
|
|
|
|
// client_id/client_secret. See YoutubePublishHandler.
|
|
|
|
|
public const PROVIDERS = ['openai', 'stability_ai', 'elevenlabs', 'youtube', 'other'];
|
2026-08-06 20:38:52 +03:00
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'name',
|
|
|
|
|
'provider',
|
|
|
|
|
'api_key',
|
|
|
|
|
'config',
|
|
|
|
|
'is_active',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'config' => 'array',
|
|
|
|
|
'is_active' => 'boolean',
|
|
|
|
|
];
|
|
|
|
|
}
|