Created
October 31, 2018 21:08
-
-
Save itsrachelfish/61d8848665196516559a6c0d99c96c55 to your computer and use it in GitHub Desktop.
Art grants exportable updates
This file contains hidden or 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
| <?php | |
| $columns = []; | |
| $data = []; | |
| foreach($exportableQuestions as $question) | |
| { | |
| $columns['question_' . $question->id] = $question->question; | |
| } |
This file contains hidden or 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
| <?php | |
| foreach($round->applications as $application) | |
| { | |
| $row = []; | |
| foreach($exportableQuestions as $question) | |
| { | |
| $row['question_' . $question->id] = $application->answers()->where('question_id', $question->id)->value('answer'); | |
| } | |
| $data[] = $row; | |
| } |
This file contains hidden or 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
| <?php | |
| $exportableQuestions = $round->questions()->where('exportable', true)->get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment