Open hirenkeraliya opened 5 years ago
What are you missing from <Model>::insert
? It's a forward to \Illuminate\Database\Query\Builder::insert
, e.g.:
Post::insert([
[
'title' => 'Title 1',
],
[
'title' => 'Title 2',
]
);
It has certain restrictions (requires the same keys everywhere, doens't use mutators) but otherwise is very efficient.
If my input is <input type="text" class="form-control" name="comments[]">
when i try to insert not works because the same key is not exists.
insert
doesn't fill in timestamps, and it doesn't seem to pay attention to the $fillable
array.
Can you Makee functionality of the createMany in eloquent if no then why?