I am trying to insert multiple entries in laravel using Order::insert($orderArray); I made a mutator which
Order::insert($orderArray);
public function setOrderDetailAttribute($value) { if ($value) { $this->attributes['order_detail'] = serialize($value); } }
the mutator is not working. But when I record a single recording using Order::create($orderArray[0][0]);Then the mutator is working fine. My question is: how can I use a mutator with insert function or bulk insert.
Order::create($orderArray[0][0]);
When you call Order::insert($orderArray);, it does not really affect Eloquent. It simply proxies the call to the Query \ Builder @insert () method.
Therefore, I think that the mutator cannot be used in this way.
Source: https://habr.com/ru/post/1648209/More articles:How to delete a file from external storage in android 5 - androidAndroid Studio debugger does not show local variables with JackOptions support - androidWebpack ExtractTextPlugin - two output files - webpackCrossword Algorithm for Android using Java - javaIs it possible to use enable_if together with typedef? - c ++AVAssetExportSession, AVMutableVideoComposition делает видео более красным - iosUICollectionSee how to deselect everything - iosprint only one line if there are continuous similar lines - stringHow I intuitively prove the time complexity of this piece of code - c ++How to get file name from url without $ _GET variable? - urlAll Articles