You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the Mappable trait only exposes additional getters/setters for the mapped columns. Is there any intention to make this trait behavior similar to laravel/framework#8200 where the "bad" column name is actually removed as a getter/setter?
Example:
MariaDB> describe cities;
+---------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
| region | varchar(5) | NO | | NULL | |
| region_id | int(11) | NO | | NULL | |
| name | varchar(100) | NO | | NULL | |
MariaDB> select * from cities;
+----+--------+-----------+-----------------+
| id | region | region_id | name |
+----+--------+-----------+-----------------+
| 1 | NY | 1 | Brooklyn |
MariaDB> describe regions;
+---------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(100) | NO | | NULL | |
MariaDB> select * from regions;
+----+------------------+
| id | name |
+----+------------------+
| 1 | New York |
The first example behaves as I would expect; however, in the second example I would expect it to return a class of type Region. Instead it's finding the underlying getter and fetching the region name.
The text was updated successfully, but these errors were encountered:
It seems that the Mappable trait only exposes additional getters/setters for the mapped columns. Is there any intention to make this trait behavior similar to laravel/framework#8200 where the "bad" column name is actually removed as a getter/setter?
Example:
The first example behaves as I would expect; however, in the second example I would expect it to return a class of type Region. Instead it's finding the underlying getter and fetching the region name.
The text was updated successfully, but these errors were encountered: