You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bit of a longshot here, I'm using the laravel-adjacency-list package in my project. This package works by having a column on a model called parent_id, which when null denotes a root level item, then, models below it, loaded in via a children relationship may have an unlimited depth.
I have three models:
MarketingAutomation
MarketingAutomationAction
MarketingAutomationActionCondition
Based on these models, the MarketingAutomationAction is the model which contains the parent_id table and functionality around that package. In addition, this model also a foreign id column to marketing_automation_id.
MarketingAutomationActionCondition models are linked to actions. So in the end, we may end up with the following hierarchy:
Marketing automation
Marketing automation action
Marketing automation action condition
Marketing automation action condition
Marketing automation action
Marketing automation action
Marketing automation action condition
Marketing automation action
Marketing automation action
Marketing automation action
I've put \Bkwld\Cloner\Cloneable on all three of these models, then, I've added the following to each:
When I attempt to clone an automation using MarketingAutomation::find(1)->duplicate(), the table structure of the. MarketingAutomationAction gets completely messed up, the parent_id column doesn't know how to relate to another model etc.
Any way to resolve this?
The text was updated successfully, but these errors were encountered:
This is a bit of a longshot here, I'm using the laravel-adjacency-list package in my project. This package works by having a column on a model called
parent_id
, which whennull
denotes a root level item, then, models below it, loaded in via achildren
relationship may have an unlimited depth.I have three models:
MarketingAutomation
MarketingAutomationAction
MarketingAutomationActionCondition
Based on these models, the
MarketingAutomationAction
is the model which contains theparent_id
table and functionality around that package. In addition, this model also a foreign id column tomarketing_automation_id
.MarketingAutomationActionCondition
models are linked to actions. So in the end, we may end up with the following hierarchy:I've put
\Bkwld\Cloner\Cloneable
on all three of these models, then, I've added the following to each:MarketingAutomation
MarketingAutomationAction
When I attempt to clone an automation using
MarketingAutomation::find(1)->duplicate()
, the table structure of the.MarketingAutomationAction
gets completely messed up, theparent_id
column doesn't know how to relate to another model etc.Any way to resolve this?
The text was updated successfully, but these errors were encountered: