35 lines
583 B
PHP
35 lines
583 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Package extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'lot',
|
|
'total_boxes',
|
|
'description',
|
|
];
|
|
|
|
protected $attributes = [
|
|
'total_boxes' => 0,
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'total_boxes' => 'integer',
|
|
'description' => 'string',
|
|
];
|
|
}
|
|
|
|
public function boxes()
|
|
{
|
|
return $this->hasMany(Box::class);
|
|
}
|
|
}
|