FK inputs handle 1:1 relationships using a simple drop-down select input.
The 1:n relationships handled by the cascade input type have to be set up properly according to the Laravel specs. GreenLight recommends to use Reliese to generate models, as relationships also get automatically generated that way.
Parameter name | Description | Default |
---|---|---|
model | Class name of the related model | |
titleKey | Name of the field to be used as option titles | title |
Model property casts that Reliese generates for models might cause problems while rendering in list views, so it is recommended to remove them.
This example represents how an Article model could be assigned to an Article Category using 1:1 connections.
Article form config:
article_category_id:
type: fk
name: Kategória
parameters:
model: ArticleCategory
Result: