feat: add lab tests, patient file management, and prescription improvements

This commit is contained in:
SajjadMahmoody
2026-04-17 20:15:38 +03:30
parent 6a301c5529
commit bf0ada051f
53 changed files with 3201 additions and 387 deletions
+31
View File
@@ -14,6 +14,37 @@ class SettingsDropdown extends Component
public bool $syncFailed = false;
public array $reportLines = [];
public function runBackup(): void
{
$dbPath = database_path('database.sqlite');
if (! file_exists($dbPath)) {
Notification::make()
->title(__('navigation.backup.failed'))
->danger()
->send();
return;
}
$backupDir = storage_path('app/backups');
if (! is_dir($backupDir)) {
mkdir($backupDir, 0755, true);
}
foreach (glob($backupDir . '/matab-backup-*.sqlite') as $oldFile) {
unlink($oldFile);
}
$filename = 'matab-backup-' . now()->format('Y-m-d_H-i-s') . '.sqlite';
copy($dbPath, $backupDir . '/' . $filename);
Notification::make()
->title(__('navigation.backup.success'))
->success()
->send();
}
public function runSync(): void
{
$service = SyncService::fromConfig();