Pārlūkot izejas kodu

Updated PS sections & routes

Samson Mutunga 3 gadi atpakaļ
vecāks
revīzija
42fe34db48

+ 1 - 10
app/Http/Controllers/HomeController.php

@@ -966,15 +966,6 @@ WHERE cl.shadow_pro_id IS NULL
         return view('app/dashboard-dna', compact( 'milliseconds'));
     }
 
-    public function dashboard_PS(Request $request){
-        $performer = $this->performer();
-        $pro = $performer->pro;
-        $performerProID = $performer->pro->id;
-
-        $milliseconds = strtotime(date('Y-m-d')) . '000'; //required by the calendar
-        return view('app/dashboard-ps', compact( 'milliseconds'));
-    }
-
     public function dashboard_ADMIN(Request $request){
         $keyNumbers = [];
 
@@ -1408,7 +1399,7 @@ WHERE cl.shadow_pro_id IS NULL
             return $this->dashboard_DNA($request);
         }else{
             //check for physician supervisor here
-            return $this->dashboard_PS($request);
+            return redirect()->route('ps.dashboard');
         }
     }
 

+ 45 - 0
app/Http/Controllers/SupervisingPhysicianController.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Lib\Backend;
+use App\Models\Appointment;
+use App\Models\AppointmentConfirmationDecision;
+use App\Models\AppSession;
+use App\Models\CareMonth;
+use App\Models\ClientMemo;
+use App\Models\ClientProChange;
+use App\Models\ClientSMS;
+use App\Models\Facility;
+use App\Models\IncomingReport;
+use App\Models\MBPayer;
+use App\Models\ProProAccess;
+use App\Models\SupplyOrder;
+use App\Models\Ticket;
+use DateTime;
+
+use App\Models\Client;
+use App\Models\Bill;
+use App\Models\Measurement;
+use App\Models\Note;
+use App\Models\Pro;
+use App\Models\ProTransaction;
+use GuzzleHttp\Cookie\CookieJar;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Cookie;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Http;
+use App\Models\OutgoingEmailTemplate;
+
+class SupervisingPhysicianController extends Controller
+{
+
+    public function dashboard(Request $request){
+        $performer = $this->performer();
+        $pro = $performer->pro;
+        $performerProID = $performer->pro->id;
+
+        $milliseconds = strtotime(date('Y-m-d')) . '000'; //required by the calendar
+        return view('app.ps.dashboard', compact( 'milliseconds'));
+    }
+}

+ 4 - 1
app/Models/Pro.php

@@ -1359,5 +1359,8 @@ ORDER BY cm.created_at DESC
         })->count();
     }
 
-
+    public function clientReviewRequests()
+    {
+        return $this->hasMany(ClientReviewRequest::class, 'pro_id');
+    }
 }

+ 0 - 0
resources/views/app/dashboard-ps.blade.php → resources/views/app/ps/dashboard.blade.php


+ 2 - 2
routes/web.php

@@ -1,6 +1,7 @@
 <?php
 
 use Illuminate\Support\Facades\Route;
+use App\Http\Controllers\SupervisingPhysicianController;
 
 /*
 |--------------------------------------------------------------------------
@@ -203,8 +204,7 @@ Route::middleware('pro.auth')->group(function () {
 
 
     Route::name('ps.')->prefix('ps')->group(function () {
-
-        Route::get('dashboard', 'HomeController@dashboard_PS')->name('dashboard');
+        Route::get('dashboard', [SupervisingPhysicianController::class, 'dashboard'])->name('dashboard');
 
     });