Closed Jeroenvanderholst closed 7 months ago
Could you narrow down the draft file to only the relevant portions.
@jasonmccreary I think I found a very simple solution. And it is not a bug. Just a misconception from my side that could be clarified / explained in the documentation. When namespacing the model, the referred model in the relationshipdefinition is already in the same namespace. Explicitly referring to the namespace like I did is redundant. So for me this issue is solved. No need to mess up your beautiful code because of this.
Issue: Relationship function generation: function name has full namespaced model name instead of only model name
I'm working on this massive yaml file, and now I am testing out the relationships. I entered relationships for EtimXchange\Catalogue hasMany: EtimXchange\CatalogueSupplier EtimXchange\CatalogSuppliers belongsTo: EtimXchange\Catalogue
As a result I see the functions in the model created like so:
EtimXchange\Catalogue public function EtimXchange\CatalogueSuppliers(): HasMany {..} EtimXchange\CatalogueSupplier public function etimXchange\Catalogue(): BelongsTo {..}
While the models are correctly namespaced : namespace App\Models\EtimXchange;
My editor squawks over the "EtimXchange\" prepending the function name.
draft.yaml: