This commit is contained in:
Čarodej
2021-11-03 17:34:46 +01:00
parent 98823504ba
commit cdaad931bb
40 changed files with 69 additions and 112 deletions
@@ -13,12 +13,12 @@ class GetFileController extends Controller
public function __construct(
private RecordDownloadAction $recordDownload,
private DownloadFileAction $downloadFile,
) {}
) {
}
public function __invoke(
string $filename,
): BinaryFileResponse {
$file = UserFile::withTrashed()
->where('basename', $filename)
->firstOrFail();
@@ -13,13 +13,13 @@ class GetThumbnailController extends Controller
{
public function __construct(
private DownloadThumbnailAction $downloadThumbnail,
) {}
) {
}
public function __invoke(
Request $request,
string $filename,
): FileNotFoundException | StreamedResponse {
$originalFileName = substr($filename, 3);
$file = File::withTrashed()
@@ -1,12 +1,11 @@
<?php
namespace Domain\Files\Controllers;
use Domain\Files\Models\File;
use Gate;
use Domain\Files\Models\File;
use Illuminate\Http\Response;
use Domain\Sharing\Models\Share;
use Domain\Files\Resources\FileResource;
use Domain\Sharing\Actions\ProtectShareRecordAction;
/**
* Get shared file record
@@ -16,7 +15,6 @@ class VisitorShowFileController
public function __invoke(
Share $shared
): Response {
$file = File::whereUserId($shared->user_id)
->whereId($shared->item_id)
->firstOrFail();