Skip to content

[Bug]: DECIMAL columns inferred as float instead of string #1316

@LWlook

Description

@LWlook

Bug description

Laravel Idea infers DECIMAL database columns as float.
At runtime, Laravel returns these values as string (to avoid precision loss), which also aligns with Doctrine DBAL documentation.

This leads to IDE types that do not match actual behavior.
laravel-ide-helper already infers DECIMAL correctly as string.

Plugin version

12.0.0.253

Operating system

Windows

Steps to reproduce

Migration:

  • $table->decimal('amount', 10, 2);

Model:

  • Eloquent model without $casts

Affected file:

  • _ide_helper_models_App_Models.php
  • Line: @property float $amount

Relevant log output

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions