-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tree的儲存$form->isCreating()會判斷為true #60
Labels
help wanted
Extra attention is needed
Comments
感谢反馈 |
刚才检查了下代码,模型树保存排序的功能是没有带行ID的,所以严格来说这个并不算问题。不知道你想要 |
用來判斷要更新創建者還是編輯者 $form->saved(function (Form $form, $result) {
if ($form->isCreating()) {
event(new CreatorUpdated($form->repository()->eloquent(), Admin::user()));
} else {
event(new UpdaterUpdated($form->repository()->eloquent(), Admin::user()));
}
}); |
看你这个像是操作日志,也许可以这样使用 $form->saved(function (Form $form, $result) {
if (request()->get('_order') && $form->isCreating()) {
// 保存排序操作
} elseif ($form->isCreating()) {
event(new CreatorUpdated($form->repository()->eloquent(), Admin::user()));
} else {
event(new UpdaterUpdated($form->repository()->eloquent(), Admin::user()));
}
}); |
好的 這樣應該OK 感謝~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
點擊tree的儲存時$form->isCreating()會判斷為true,可能是因為送出的是post
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: