Currently, the write_model_relation_exists_properties config option only writes these properties if the relation is a many return type https://github.com/barryvdh/laravel-ide-helper/blob/master/src/Console/ModelsCommand.php#L826
Our use case is as follows:
We have a User model, and several different types of users with various properties that may be linked to the User via user_id/a HasOne relationship. When sending data to the frontend, we include the various _exists fields to be used as flags for the frontend to control which portions of the ui are shown and/or enabled. We don't always need the actual contents of the related models, so a true/false for the existence works for us. It would be great if the _exists properties could be added for these types of relationships.
Querying for existence/absence is not dependent on the relationship being a many-X https://laravel.com/docs/12.x/eloquent-relationships#querying-relationship-existence
Currently, the
write_model_relation_exists_propertiesconfig option only writes these properties if the relation is amanyreturn type https://github.com/barryvdh/laravel-ide-helper/blob/master/src/Console/ModelsCommand.php#L826Our use case is as follows:
We have a User model, and several different types of users with various properties that may be linked to the User via
user_id/aHasOnerelationship. When sending data to the frontend, we include the various_existsfields to be used as flags for the frontend to control which portions of the ui are shown and/or enabled. We don't always need the actual contents of the related models, so a true/false for the existence works for us. It would be great if the_existsproperties could be added for these types of relationships.Querying for existence/absence is not dependent on the relationship being a many-X https://laravel.com/docs/12.x/eloquent-relationships#querying-relationship-existence