Laravel app with a cost-tracked Runware.ai integration (image, video, text generation), a hard monthly EUR budget cap with live USD/EUR FX conversion, and a locally-maintained model/pricing table since Runware's model-search API doesn't expose pricing.
35 lines
645 B
PHP
35 lines
645 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Generation extends Model
|
|
{
|
|
protected $fillable = [
|
|
'batch_id',
|
|
'type',
|
|
'model',
|
|
'prompt',
|
|
'params',
|
|
'status',
|
|
'runware_task_uuid',
|
|
'cost_usd',
|
|
'cost_eur',
|
|
'cost_is_estimated',
|
|
'output_path',
|
|
'output_text',
|
|
'error',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'params' => 'array',
|
|
'cost_usd' => 'decimal:6',
|
|
'cost_eur' => 'decimal:6',
|
|
'cost_is_estimated' => 'boolean',
|
|
];
|
|
}
|
|
}
|