38 lines
654 B
PHP
38 lines
654 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',
|
|
'box_number',
|
|
'starting_page',
|
|
'ending_page',
|
|
'module_id',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'starting_page' => 'integer',
|
|
'ending_page' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function module()
|
|
{
|
|
return $this->belongsTo(Module::class);
|
|
}
|
|
|
|
public function tags()
|
|
{
|
|
return $this->hasMany(Tag::class);
|
|
}
|
|
}
|