Created
December 8, 2014 23:59
-
-
Save techhazard/b722549958b9cd519faa to your computer and use it in GitHub Desktop.
Laravel chaining reations?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have several Models: | |
Course (id, line_id, category_id name...) | |
Category (id,name...) | |
Line (id, name...) | |
Semester (id, year_id, name...) | |
Year (id, study_id, name...) | |
Study (id,name...) | |
and 1 pivot table | |
course_semester. | |
I am already able to make an object/array of a course which contains: | |
course = { | |
id, | |
name, | |
..., | |
line = { | |
id, | |
name, | |
... | |
}, | |
category = { | |
id, | |
name, | |
... | |
}, | |
semesters = { | |
{id, name, ...}, | |
{id, name, ...}, | |
... | |
} | |
} | |
What I want to add in this object/array is: | |
study = {id, name, ...} | |
How would I do this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment