|
@@ -44,4 +44,16 @@ class Note extends Model
|
|
|
->where('is_active', true)
|
|
|
->orderBy('position_index', 'asc');
|
|
|
}
|
|
|
+
|
|
|
+ public function summary()
|
|
|
+ {
|
|
|
+ $parts = [];
|
|
|
+ foreach ($this->sections as $section) {
|
|
|
+ $parts[] = $section->summary_html;
|
|
|
+ }
|
|
|
+ $parts = array_map(function($_part) {
|
|
|
+ return '<div class="note-section-summary">' . $_part . '</div>';
|
|
|
+ }, $parts);
|
|
|
+ return implode("", $parts);
|
|
|
+ }
|
|
|
}
|