DataForm should show something else if entry passed not found. #1371
Closed
karandatwani92
started this conversation in
Public Beta
Replies: 1 comment
-
Thanks @karandatwani92 I've spent sometime around this issue, I don't think there is anything for us to do here. You as a developer have multiple ways to deal with non-found entries, and probably the most correct is to NOT show the form at all, if the entry you would like to edit is not present. So if you are concerned or not sure, if the entry you are setting up for edit is always available, you can do a if ($entry = \App\Model::find($id)) {
// form component definition
'entry' => $entry,
} If you disagree or have a better alternative please share it with us 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In DataForm Example
https://github.com/Laravel-Backpack/demo/blob/990765ca60409f40f91e395927149e8353d812ff/resources/views/admin/new-in-v7.blade.php#L16
What if pass an entry which does not exist in the DB.
'entry' => \App\Models\PetShop\Skill::find(10000001),
🚨Currently, it gives me an empty edit form, and behind the seen working as a create Form.
Beta Was this translation helpful? Give feedback.
All reactions