laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Virtual and stored column are not read only

Open nandi95 opened this issue 1 year ago • 0 comments

Versions:

  • ide-helper Version: 2.13.0
  • Laravel Version: 10.18.0
  • PHP Version: 8.2.8

Description:

The package seems to generate @property for columns in the database that are virtual columns or result of a stored procedure. I think these columns should be @property-read as they are meant to be read only (even-though you might change it on the model).

Steps To Reproduce:

Create a migration with a virtual or stored column:

$table->float('cost');
$table->float('unit_amount');
$table->float('unit_cost')->virtualAs('cost / unit_amount');

nandi95 avatar Aug 17 '23 18:08 nandi95