EnsureClientIsShadowOfPro.php 541 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Middleware;
  3. use App\Models\AppSession;
  4. use Closure;
  5. class EnsureClientIsShadowOfPro
  6. {
  7. /**
  8. * Handle an incoming request.
  9. *
  10. * @param \Illuminate\Http\Request $request
  11. * @param \Closure $next
  12. * @return mixed
  13. */
  14. public function handle($request, Closure $next)
  15. {
  16. $patient = \request()->route('patient');
  17. if(!!$patient) {
  18. if(!$patient->shadow_pro_id) {
  19. abort(403);
  20. }
  21. }
  22. return $next($request);
  23. }
  24. }