32 lines
742 B
PHP
32 lines
742 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PackageItem extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'package_id', 'status', 'target_json', 'payload_json', 'attempts', 'last_error', 'result_json', 'provider_message_id', 'cost', 'currency', 'idempotency_key',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'target_json' => 'array',
|
|
'payload_json' => 'array',
|
|
'result_json' => 'array',
|
|
'attempts' => 'integer',
|
|
'cost' => 'decimal:4',
|
|
];
|
|
}
|
|
|
|
public function package()
|
|
{
|
|
return $this->belongsTo(Package::class);
|
|
}
|
|
}
|