I am having a problem in a laravel project, i have this entity where it is self referncing. I am creating a PPA (program,project,activity) Entity . So this belongs in an Rc_Indicator Entity. The problem is i do not know to create the self referencing .
So there it how it goes. An Indicator >Program > Project > Activity .
However, an indicator , may ONLY have ACTIVITIES , no program, or project, or the indicator may have a program only have either Project or Activity.
Ex.)
Rc_Indicator 1
-Program 1.1
-Project 1.1.1
-Activity 1.1.1
-Activity 1.1.12
Ex.)
Rc_Indicator 2
-Program 2.1
-Program 2.2
-Project 2.2.1
Ex.)
Rc_Indicator 3
-Activity 1
Can u suggest a controller or model?
3
Answers
Try defining
parent
andchildren
field:The model looks like this: