thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.72k stars 2.67k forks source link

BREAD - Add with relationship #5708

Open toto975 opened 1 year ago

toto975 commented 1 year ago

Laravel version

9.31.0

PHP version

8.1.11

Voyager version

1.5

Database

MySQL 8.0.31

Description

Add data with a relation My model : Parcours has one Cadre

Steps to reproduce

In the BREAD of Parcours, if the "Add" is unchecked

image

there is a SQL error image

It's OK, because the foreign key cadre_id is not into the SQL query.

When the "Add" is checked, no SQL error. It's OK

When i edit the "Parcours", "edit" for cadre_id can be checked or unchecked, query is OK.

Expected behavior

When adding data with relationship, why "add" for foreign key must be checked ? Why it's not possible to unchecked like "edit" ?

Screenshots

No response

Additional context

No response