radfusion/app/Http/Controllers/HashedStudyControllerBase.php
2025-01-15 11:24:09 +06:00

33 lines
826 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Study;
class HashedStudyControllerBase extends HashidControllerBase
{
protected ?Study $study = null;
protected function getStudy(array|string|null $relations = null): Study
{
$this->decodeKeys();
if ($relations !== null) {
$this->study = Study::with($relations)->findOrFail($this->key);
} else {
$this->study = Study::findOrFail($this->key);
}
return $this->study;
}
protected function lockedNotice()
{
return view('content.pages.notice', [
'title' => 'Study Locked',
'color' => 'danger',
'heading' => 'Study Locked',
'message' => 'Study metadata cannot be edited once the report has been finalized.',
]);
}
}