*/ use HasFactory; protected $fillable = [ 'code', 'name', 'address', 'description', ]; public function inventories(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(Inventory::class); } public function purchaseOrders(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(PurchaseOrder::class); } public function products(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { return $this->belongsToMany(Product::class, 'inventories') ->withPivot(['quantity', 'safety_stock', 'location']) ->withTimestamps(); } }