38 lines
860 B
PHP
38 lines
860 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Guarded(['id'])]
|
|
class StockEcerHistory extends Model
|
|
{
|
|
protected $table = 'stock_ecer_histories';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'quantity' => 'integer',
|
|
'stock_before' => 'integer',
|
|
'stock_ecer_before' => 'integer',
|
|
'stock_after' => 'integer',
|
|
'stock_ecer_after' => 'integer',
|
|
'created_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function productVariant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ProductVariant::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|