I have news model that has categories with many to many relation.
when i clone this model, it attributes copied, but relations are not copy!
this is my code:
$duplicateNews = clone $this;
$duplicateNews->id = null;
$duplicateNews->isNewRecord = true;
$this->categories exist and has value
but $duplicateNews is not exist
what should I do?
please help me.