Migu Posted June 27, 2022 Share Posted June 27, 2022 Hello, I have a problem when saving repeater. When I do the following I always have a duplicate entry. $notification = $user->notifications->getNew(); $notification->messageid = $arr_data['messageid']; $notification->notificationid = $arr_data['notificationid']; $notification->users = $arr_data['userid']; $notification->date = time(); $notification->save(); $user->notifications->add($notification); $user->save(); What am I doing wrong? Thanks for feedback Link to comment Share on other sites More sharing options...
Migu Posted June 27, 2022 Author Share Posted June 27, 2022 As a note, in the Tracy debugger it works but as soon as I make an ajax call there is a duplicate entry. Link to comment Share on other sites More sharing options...
Migu Posted June 27, 2022 Author Share Posted June 27, 2022 Sorry, just solved it, I had two consecutive Ajax request, hence the duplicate entries. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now