EditRecord page not including user relation

I am trying to render some relational fields in the form of my CouponCode model.
TextInput::make('user.email')
->readOnly()
->disabled(),
TextInput::make('user.email')
->readOnly()
->disabled(),
The relation in the CouponCode model:
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
The migration files includes:
$table->foreignUlid('user_id')
->nullable()
->constrained('users');
$table->foreignUlid('user_id')
->nullable()
->constrained('users');
Am I doing something wrong here?
Solution:
use ```php Group::make([ TextInput::make('email')...
Jump to solution
3 Replies
Solution
LeandroFerreira
use
Group::make([
TextInput::make('email')
])->relationship('user')
Group::make([
TextInput::make('email')
])->relationship('user')
Kaaiman
KaaimanOP3w ago
Is that something new? Never seen that before But it works. Thank you 🙏

Did you find this page helpful?