Using repeater to create bulk inserts.
Hi Everyone,
I am using repeater to insert bulk data but i am getting following error.
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: daily_entries.publication_id (Connection: sqlite, SQL: insert into "daily_entries" ("client_id", "updated_at", "created_at") values (1, 2024-10-09 09:19:10, 2024-10-09 09:19:10))Form screenshot attached. I want users to select the client once and use the same for all the daily entries. Attached code as image for your reference.
3 Replies
it's telling you, you need to set the publication_id
is that fillable within the model
Yes the model is fillable. If try to insert using the same resource without Repeater. It is inserting properly but with repeater i am getting that error.
@PovilasKorop Need your input on this.
Something in your last method is not setting the item, only the client_id, so all other fields are ignored. Hard to blindly debug it, maybe item should be &$item as parameter?
Double check the syntax for that specific method in the docs, you probably missed the place how that item is autoset
I'm off computer so can't quickly google for you, sorry