29 lines
677 B
PHP
29 lines
677 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class StoreInventory extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['store_id', 'current_code_balance', 'prepaid_balance', 'last_updated_at'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'current_code_balance' => 'integer',
|
|
'prepaid_balance' => 'integer',
|
|
'last_updated_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function store(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PartnerStore::class, 'store_id');
|
|
}
|
|
}
|