How to create mutiple things with one resource?
I trid to overwrite create process wthhandleRecordCreation()
but I got the excetion like this
12 Replies
You are returning an array and not model instance. Why do you use $result at all, if you are not doing anything with it? You always return an empty array.
Ijust remove $result because I got another exception
Now you are returning nothing. Remove return type declaration.
or set it to : voidBut that function needs to return a Model, so my solution will not work Anyway, what are you trying to achieve? When $data is passed to that function it creates all that it needs to be created, no need to alter anything If you need some additional things, you could use
afterCreate
functionI 'm tring to create mutiple things with one form and Do you have any perfect advice?
What kind of multiple things? If same model is used, that is done by default based on form data passed
OK it's same model
here is my form
and I jus use repeater
you need JSON column for this, and that is it
Solution
No need to overwrite any function
Read the docs, they are really good.
ok let me check docs , Thank you