storage and image model
This commit is contained in:
@@ -23,25 +23,13 @@ class FileController extends Controller
|
||||
private readonly ChannelService $channelService,
|
||||
private readonly RecordService $recordService,
|
||||
private readonly FileService $fileService,
|
||||
private readonly ImageService $imageService,
|
||||
private readonly Query $query
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function template(Request $request)
|
||||
{
|
||||
$template = $request->segment(3);
|
||||
$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($schema->disk);
|
||||
return response()->file($disk->path("templates/".$templatePath));
|
||||
}
|
||||
|
||||
public function original(Request $request, string $disk)
|
||||
public function fromDisk(Request $request, string $disk)
|
||||
{
|
||||
$imagePath = $request->route("any");
|
||||
$disk = $this->fileService->loadDisk($disk);
|
||||
|
||||
Reference in New Issue
Block a user