I have an OrderResource which I use to show Orders and OrderItems. Each order Item belongs to an Order and also to a User. In de repeater which I have in the Resource I want to show the Username who created the OrderItem (user.name) So I have done this:
In the OrderItem Model I have created a relationship:
public function user(): BelongsTo { return $this->belongsTo(User::class); }
public function user(): BelongsTo { return $this->belongsTo(User::class); }