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
Currently we have a HasOne attribute that allows you to define and optionally override the inverse relation of BelongsTo.
We need attributes for other types of relations as well though, to make sure that users have to ability to override Tempest's default relation inference.
#[BelongsTo('inverseName')]
#[HasMany('inverseName')]
Optionally, we may allow something like this:
class Book
{
#[BelongsTo('books.author_id', 'authors.id')]
publicAuthor$author;
// …
}
This would be in line with how migrations handle relations.
These attributes shouldn't be used by default, but should be available to solve the edge cases.
Docs:
Document these attributes
Document relation loading via the query builder
The text was updated successfully, but these errors were encountered:
Currently we have a
HasOne
attribute that allows you to define and optionally override the inverse relation ofBelongsTo
.We need attributes for other types of relations as well though, to make sure that users have to ability to override Tempest's default relation inference.
#[BelongsTo('inverseName')]
#[HasMany('inverseName')]
Optionally, we may allow something like this:
This would be in line with how migrations handle relations.
These attributes shouldn't be used by default, but should be available to solve the edge cases.
Docs:
The text was updated successfully, but these errors were encountered: