refactor files

This commit is contained in:
2024-09-19 23:36:43 +03:00
parent d0cd8228cc
commit 32c8378020
6 changed files with 13 additions and 19 deletions
+2 -1
View File
@@ -35,8 +35,9 @@ class FileController extends Controller
$templatePath = $request->route("any");
$filePath = str_replace($template."/", "", $templatePath);
$record = $this->query->filter(["_file.path" => $filePath])->run()->records->first();
$schema = $this->channelService->getSchema($record->schema);
$this->imageService->file($record,$template);
$disk = $this->fileService->loadDisk();
$disk = $this->fileService->loadDisk($schema->disk);
return response()->file($disk->path("templates/".$templatePath));
}
+1
View File
@@ -15,6 +15,7 @@ use Lucent\Http\Controller\SetupController;
Route::get('/lucent/setup', [SetupController::class, 'setup']);
Route::get('/storage/templates/{any}', [FileController::class, 'template'])->where('any', '.*');
//Route::get('/storage/thumbs/{any}', [FileController::class, 'thumb'])->where('any', '.*');
Route::group([
'middleware' => ['web'],