Relationship
trait Relationship (View source)
Methods
string
getKey()
Get the table key
belongsTo(string $related, string|null $foreign_key = null, string|null $local_key = null)
The has one relative
belongsToMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)
The belongs to many relative
hasMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)
The has many relative
Details
abstract string
getKey()
Get the table key
BelongsTo
belongsTo(string $related, string|null $foreign_key = null, string|null $local_key = null)
The has one relative
BelongsToMany
belongsToMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)
The belongs to many relative
HasMany
hasMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)
The has many relative
HasOne
hasOne(string $related, string|null $primary_key = null, string|null $foreign_key = null)
The has one relative