feat: enums, schema and models for hado core
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
34
core/app/Models/Delivery.php
Normal file
34
core/app/Models/Delivery.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\DeliveryResult;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Delivery extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
protected $attributes = ['meta' => '{}'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'result' => DeliveryResult::class,
|
||||
'window_start' => 'immutable_datetime',
|
||||
'sent_at' => 'immutable_datetime',
|
||||
'meta' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
public function event(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Channel::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user