24 lines
694 B
PHP
24 lines
694 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Staff;
|
|
|
|
use App\Domain\ACL\Permission;
|
|
use App\Http\Controllers\HashidControllerBase;
|
|
use App\Models\Study;
|
|
|
|
class ReportController extends HashidControllerBase
|
|
{
|
|
public function popup()
|
|
{
|
|
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportDownload]), 403);
|
|
$this->decodeKeys();
|
|
$study = Study::with('reports')->findOrFail($this->key);
|
|
if (me()->isRadiologist()) {
|
|
abort_unless($study->isAssignedTo(), 403);
|
|
}
|
|
$reports = $study->reports->sortByDesc('created_at');
|
|
|
|
return view('staff.reports.popup', compact('study', 'reports'));
|
|
}
|
|
}
|