Explorar el Código

Remove Note::all() call from base controller

Vijayakrishnan hace 4 años
padre
commit
aa4563a058

+ 1 - 1
app/Http/Controllers/Controller.php

@@ -48,7 +48,7 @@ class Controller extends BaseController
         }*/
 
         view()->share('pros',$this->pros);
-        view()->share('notes', Note::all());
+        // view()->share('notes', Note::all());
 
         // $noteTemplates = NoteTemplate::all();
         // view()->share('noteTemplates', $noteTemplates);

+ 1 - 0
resources/views/app/patient/care-month/dashboard.blade.php

@@ -60,6 +60,7 @@
                                             class="form-control form-control-sm if-visit-done"
                                             onchange="toggleVisibilityAsNeeded(this, '', 'if-note-outside-system')">
                                         <option value="">-- Visit Note --</option>
+                                        <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
                                         @foreach ($notes as $note)
                                             @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
                                                 <option value="{{$note->uid}}">{{$note->title}}</option>

+ 1 - 0
resources/views/app/patient/settings.blade.php

@@ -472,6 +472,7 @@
                             class="form-control form-control-sm if-visit-done"
                             onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
                         <option value="">-- Visit Note --</option>
+                        <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
                         @foreach ($notes as $note)
                             @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
                                 <option

+ 1 - 0
resources/views/layouts/patient.blade.php

@@ -467,6 +467,7 @@
                                                             class="form-control form-control-sm if-visit-done"
                                                             onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
                                                         <option value="">-- Visit Note --</option>
+                                                        <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
                                                         @foreach ($notes as $note)
                                                             @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
                                                                 <option