0

On laravel 11 / nova 4 app I I have User model with method :

public function userProfile(): HasOne
{
    return $this->hasOne(UserProfile::class);
}

and in UserProfile model :

public function user(): BelongsTo
{
    return $this->belongsTo(User::class);
}

and in userProfile editor page I added readonly element:

BelongsTo::make(name:'User', attribute:'user', resource:User::class)->readonly(),

to show user to which this UserProfile belongs to.

Next I need to mae a link to User editor, but I did not find any component which can be used as reference to related model which I define.

I checked some inputs, like 'https://nova.laravel.com/docs/v4/resources/fields#url-field' :

But did not find anything similar ... Are there some thing to such reference to related model ?

2
  • 1
    Did I understand correctly that you need to show related UserProfiles inside User page? Commented Sep 12 at 9:00
  • Yes, it must looks like 1 foerm, but 2 tables in db Commented Oct 29 at 15:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.