Skip to main content

Relation Has One

Badaso provides a feature to use Has One relation. For more details about Has One, you can visit documentation laravel.

Set Relation Has One#

For use this feature, you can follow the step below:

  • Previously, using CRUD Management, first create a table that will generate CRUD. Example "books" dan "categories".

  • Create a CRUD management for the "books" table, then create a CRUD management for the "categories" table as shown below:

    • Click button "set other relation". Add relation Has One

    • Choice relation type, destination table, destination column, and destination column to display. Add relation Has One set options

    • but, if you have table polymorphism, you can use that with feature advanced setting and choice polymorphism table. after add relation has one

  • Save and save CRUD.

Note: If you use a model, you must also use the model in the relation table.

Result#

Result has Many