add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
@@ -5,6 +5,7 @@ namespace App\Services\ClassProgress;
use App\Models\ClassProgressAttachment;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
class ClassProgressAttachmentService
{
@@ -16,7 +17,7 @@ class ClassProgressAttachmentService
$stored = [];
foreach ($files as $file) {
if (! $file instanceof UploadedFile || ! $file->isValid()) {
if (!$file instanceof UploadedFile || !$file->isValid()) {
continue;
}
@@ -48,17 +49,17 @@ class ClassProgressAttachmentService
$candidates = [];
if (str_starts_with($path, 'storage/')) {
$relative = ltrim(substr($path, strlen('storage/')), '/');
$candidates[] = storage_path('app/public/'.$relative);
$candidates[] = storage_path('app/public/' . $relative);
}
if (str_starts_with($path, 'writable/uploads/')) {
$relative = ltrim(substr($path, strlen('writable/uploads/')), '/');
$candidates[] = storage_path('app/'.$relative);
$candidates[] = storage_path('app/public/'.$relative);
$candidates[] = storage_path('app/' . $relative);
$candidates[] = storage_path('app/public/' . $relative);
}
$candidates[] = storage_path('app/'.ltrim($path, '/'));
$candidates[] = storage_path('app/public/'.ltrim($path, '/'));
$candidates[] = storage_path('app/' . ltrim($path, '/'));
$candidates[] = storage_path('app/public/' . ltrim($path, '/'));
foreach ($candidates as $candidate) {
if (is_file($candidate)) {
@@ -83,6 +84,6 @@ class ClassProgressAttachmentService
throw $e;
}
return 'storage/'.ltrim($path, '/');
return 'storage/' . ltrim($path, '/');
}
}