41 lines
804 B
PHP
41 lines
804 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ProductionPackaging extends Model
|
|
{
|
|
protected $fillable = [
|
|
'production_id',
|
|
'packaging_item_id',
|
|
'quantity_used',
|
|
];
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'quantity_used' => 'integer',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<Production, $this>
|
|
*/
|
|
public function production(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Production::class);
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<PackagingItem, $this>
|
|
*/
|
|
public function packagingItem(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PackagingItem::class);
|
|
}
|
|
}
|