New BelongsTo field corresponds to a belongsTo Eloquent relationship

New BelongsTo field corresponds to a belongsTo Eloquent relationship

Eg, let’s hypothetically say an article design belongsTo a person design. We may range from the link to our Article Nova funding such as myladyboydate buluÅŸma so:

You might modify the capital classification utilized by brand new relation field by the means another and third parameters of your own build approach:

# Label Functions

Whenever a beneficial BelongsTo job try revealed on a source manufacturing / improve screen, a decline-off alternatives eating plan or research diet plan tend to monitor the newest “title” of one’s financing. Instance, a person resource e characteristic as the term. Then, in the event the resource try revealed for the a good BelongsTo selection diet plan, that characteristic would be showed:

# Carrying out Connections

When making a resource, it’s also possible to want to manage a unique funding in order to connect with the modern you to you’re performing. Nova makes it possible for which giving a good ‘create relation’ option 2nd into the BelongsTo get a hold of container, and this open a beneficial modal window enabling you to create the the new funding. That is permitted automagically, you can customize it choices using the showCreateRelationButton and hideCreateRelationButton procedures:

# BelongsToMany

The latest BelongsToMany field corresponds to an excellent belongsToMany Eloquent dating. Such as for instance, let’s hypothetically say a user design belongsToMany Part designs. We would range from the relationship to all of our Associate Nova resource particularly so:

# Rotate Industries

Whether your belongsToMany relationships interacts with more “pivot” industries which can be stored to your advanced table of all-to-of a lot matchmaking, you may also mount people on the BelongsToMany Nova matchmaking. Shortly after these industries is attached to the dating field, in addition to relationships has been defined toward both sides, they shall be demonstrated on associated resource directory.

Such, let`s say all of our Associate design belongsToMany Character designs. For the our very own part_user advanced dining table, let’s say you will find a notes occupation that has some easy text cards towards matchmaking. We are able to mount this rotate job for the BelongsToMany job using the fresh industries approach:

It is likely we may also establish so it community for the inverse of dating. Thus, if we establish this new BelongsToMany career on Associate resource, we might explain the inverse toward Character resource:

Given that determining industry towards each other concludes of your own dating can also be produce certain code replication, Nova enables you to violation an enthusiastic invokable target into sphere method:

# Rotate Steps

Typically, Nova strategies run on a source. But not, you may want to mount tips in order to belongsToMany industries so they can be operate on pivot / advanced table records. To achieve this, you could strings those things strategy on your field’s definition:

As step has been connected to the job, it’s possible to find the step and play it about relationship index to the parent’s resource outline display.

# Identity Properties

Whenever a great BelongsToMany career is found into the a source development / modify display screen, a drop-off selection eating plan otherwise search selection tend to display the new “title” of your own resource. Such as for instance, a task financial support age trait as the title. Then, in the event that financial support are found from inside the an excellent BelongsToMany alternatives selection, you to trait is demonstrated:

# MorphOne

The newest MorphOne occupation corresponds to a great morphOne Eloquent matchmaking. Such as for example, let`s say a blog post keeps a single-to-you to polymorphic relationship with the picture model. We would add the relationship to our very own Blog post Nova capital such as for instance so:

# MorphMany

This new MorphMany industry corresponds to a great morphMany Eloquent dating. Instance, let’s assume an article provides a-one-to-many polymorphic experience of brand new Opinion model. We would add the link to our very own Post Nova financial support instance so:

# MorphTo

The fresh new MorphTo field corresponds to a morphTo Eloquent matchmaking. Eg, let’s hypothetically say a review model keeps an effective polymorphic relationship with one another new Blog post and Films designs. We might are the link to the Remark Nova financing for example so:

Vélemény, hozzászólás?

Az e-mail-címet nem tesszük közzé.