I was playing with laravel Eloquent and found that it doesn't support Batch Insert i.e.multiple row at once like
Model::insert($array_of_data);
What is the reason for this ?
Thank you for any suggestion .
I was playing with laravel Eloquent and found that it doesn't support Batch Insert i.e.multiple row at once like
Model::insert($array_of_data);
What is the reason for this ?
Thank you for any suggestion .
It doesn't because of for models you might have extended logic. For example when creating new database entry you might want to to verify previous records to find out for example this record identifier and doing it with single query is not possible, so you can either you use batch inserts using query builder or simple use loop to create many records but in case of multiple records in 2nd case it might obviously affect performance.