diff --git a/app/Http/Controllers/FileController.php b/app/Http/Controllers/FileController.php deleted file mode 100644 index f159a36..0000000 --- a/app/Http/Controllers/FileController.php +++ /dev/null @@ -1,89 +0,0 @@ -castParams == 'resource') { - return new FileResource(app()->file); - } - if (!is_null(array_intersect(array_keys($request->all()), $this->availableParams))) { - $data = $imageProcessor->processToBuffer(app()->file->getPath(), $request->all()); - $response = Response::make($data, 200); - $response->header('Content-Type','image/webp'); - return $response; - } - return response()->file(app()->file->getPath()); - } - - public function store(FileStoreRequest $request, ImageProcessor $imageProcessor) - { - - $request->file = $imageProcessor->convertImage($request->file->path(), '/tmp/' . app()->uuid . '.' . app()->collection->ext); - if (!is_null(app()->collection->process)) { - $request->file = $imageProcessor->process($request->file->path(), '/tmp/' . app()->uuid . '.' . app()->collection->ext, app()->collection->process); - } - - $fileResource = null; - DB::transaction(function () use ($request, &$fileResource) { - $uuid = app()->uuid; - $fileResource = File::create([ - 'uuid' => $uuid, - 'original_name' => $request->name, - 'public' => $request->public, - 'ext' => $request->file->extension(), - 'mimetype' => $request->file->getMimeType(), - 'width' => getimagesize($request->file)[0], - 'height' => getimagesize($request->file)[1], - 'file_size' => $request->file->getSize(), - 'sort' => $request->file->getSize(), - 'alts' => $request->alts, - 'description' => $request->description, - 'user_id' => auth()->id(), - 'ip' => $request->ip(), - 'collection_id' => app()->collection->id, - 'published_at' => $request->published_at, - 'server_path' => '/' . date('y') . '/' . date('m') . '/', - ]); - if (!app()->collection->tmp_support && app()->collection->count == 1) { - File::where('user_id', auth()->id())->delete(); - } - - - $storedFile = Storage::disk(app()->collection->disk)->putFileAs($fileResource->server_path, $request->file, $fileResource->uuid . '.' . app()->collection->ext); - - if (app()->collection->public) { - Storage::disk(app()->collection->disk)->setVisibility($storedFile, 'public'); - } - }); - - return new FileResource($fileResource); - } - - public function update(FileUpdateRequest $request) - { - app()->file->update($request->all()); - return new FileResource(app()->file); - } - - public function destroy() - { - if (app()->file->trashed()) { - return app()->file->restore(); - } - return app()->file->delete(); - } -} diff --git a/storage/stub/00.webp b/storage/stub/00.webp deleted file mode 100644 index 0cb7eba..0000000 Binary files a/storage/stub/00.webp and /dev/null differ diff --git a/storage/stub/000.png b/storage/stub/000.png deleted file mode 100644 index e69de29..0000000 diff --git a/storage/stub/001.webp b/storage/stub/001.webp deleted file mode 100644 index c667c6d..0000000 Binary files a/storage/stub/001.webp and /dev/null differ diff --git a/storage/stub/0010.png b/storage/stub/0010.png deleted file mode 100644 index 111504f..0000000 Binary files a/storage/stub/0010.png and /dev/null differ diff --git a/storage/stub/0011.png b/storage/stub/0011.png deleted file mode 100644 index a483683..0000000 Binary files a/storage/stub/0011.png and /dev/null differ diff --git a/storage/stub/0012.png b/storage/stub/0012.png deleted file mode 100644 index 88e5bfc..0000000 Binary files a/storage/stub/0012.png and /dev/null differ diff --git a/storage/stub/0013.png b/storage/stub/0013.png deleted file mode 100644 index da307b5..0000000 Binary files a/storage/stub/0013.png and /dev/null differ diff --git a/storage/stub/0014.png b/storage/stub/0014.png deleted file mode 100644 index 6cfb859..0000000 Binary files a/storage/stub/0014.png and /dev/null differ diff --git a/storage/stub/0015.png b/storage/stub/0015.png deleted file mode 100644 index 61a622b..0000000 Binary files a/storage/stub/0015.png and /dev/null differ diff --git a/storage/stub/0016.png b/storage/stub/0016.png deleted file mode 100644 index c95e0ae..0000000 Binary files a/storage/stub/0016.png and /dev/null differ diff --git a/storage/stub/0017.png b/storage/stub/0017.png deleted file mode 100644 index cd9613c..0000000 Binary files a/storage/stub/0017.png and /dev/null differ diff --git a/storage/stub/0017.webp b/storage/stub/0017.webp deleted file mode 100644 index eb8f24e..0000000 Binary files a/storage/stub/0017.webp and /dev/null differ diff --git a/storage/stub/002.png b/storage/stub/002.png deleted file mode 100644 index 43a7998..0000000 Binary files a/storage/stub/002.png and /dev/null differ diff --git a/storage/stub/003.webp b/storage/stub/003.webp deleted file mode 100644 index 1375e3b..0000000 Binary files a/storage/stub/003.webp and /dev/null differ diff --git a/storage/stub/004.png b/storage/stub/004.png deleted file mode 100644 index a21cf76..0000000 Binary files a/storage/stub/004.png and /dev/null differ diff --git a/storage/stub/005.png b/storage/stub/005.png deleted file mode 100644 index fc7292e..0000000 Binary files a/storage/stub/005.png and /dev/null differ diff --git a/storage/stub/006.png b/storage/stub/006.png deleted file mode 100644 index d4121ae..0000000 Binary files a/storage/stub/006.png and /dev/null differ diff --git a/storage/stub/007.png b/storage/stub/007.png deleted file mode 100644 index 6455931..0000000 Binary files a/storage/stub/007.png and /dev/null differ diff --git a/storage/stub/008.png b/storage/stub/008.png deleted file mode 100644 index 906a93c..0000000 Binary files a/storage/stub/008.png and /dev/null differ diff --git a/storage/stub/009.png b/storage/stub/009.png deleted file mode 100644 index 9f78d6a..0000000 Binary files a/storage/stub/009.png and /dev/null differ diff --git a/storage/stub/01.webp b/storage/stub/01.webp deleted file mode 100644 index a73cd9d..0000000 Binary files a/storage/stub/01.webp and /dev/null differ diff --git a/storage/stub/02.webp b/storage/stub/02.webp deleted file mode 100644 index 718604d..0000000 Binary files a/storage/stub/02.webp and /dev/null differ diff --git a/storage/stub/03.webp b/storage/stub/03.webp deleted file mode 100644 index dc996d5..0000000 Binary files a/storage/stub/03.webp and /dev/null differ diff --git a/storage/stub/04.webp b/storage/stub/04.webp deleted file mode 100644 index 01ad696..0000000 Binary files a/storage/stub/04.webp and /dev/null differ diff --git a/storage/stub/05.webp b/storage/stub/05.webp deleted file mode 100644 index cb908f0..0000000 Binary files a/storage/stub/05.webp and /dev/null differ diff --git a/storage/stub/06.webp b/storage/stub/06.webp deleted file mode 100644 index da8d47d..0000000 Binary files a/storage/stub/06.webp and /dev/null differ diff --git a/storage/stub/07.webp b/storage/stub/07.webp deleted file mode 100644 index 709c627..0000000 Binary files a/storage/stub/07.webp and /dev/null differ diff --git a/storage/stub/08.webp b/storage/stub/08.webp deleted file mode 100644 index c0d9731..0000000 Binary files a/storage/stub/08.webp and /dev/null differ diff --git a/storage/stub/09.webp b/storage/stub/09.webp deleted file mode 100644 index 56d5d59..0000000 Binary files a/storage/stub/09.webp and /dev/null differ diff --git a/storage/stub/10.webp b/storage/stub/10.webp deleted file mode 100644 index 890c12e..0000000 Binary files a/storage/stub/10.webp and /dev/null differ diff --git a/storage/stub/100.png b/storage/stub/100.png deleted file mode 100644 index 8246387..0000000 Binary files a/storage/stub/100.png and /dev/null differ diff --git a/storage/stub/11.webp b/storage/stub/11.webp deleted file mode 100644 index 3d2ccfa..0000000 Binary files a/storage/stub/11.webp and /dev/null differ diff --git a/storage/stub/13.webp b/storage/stub/13.webp deleted file mode 100644 index 709685f..0000000 Binary files a/storage/stub/13.webp and /dev/null differ diff --git a/storage/stub/14.webp b/storage/stub/14.webp deleted file mode 100644 index cecd24c..0000000 Binary files a/storage/stub/14.webp and /dev/null differ diff --git a/storage/stub/16.webp b/storage/stub/16.webp deleted file mode 100644 index 4f0142e..0000000 Binary files a/storage/stub/16.webp and /dev/null differ diff --git a/storage/stub/17.webp b/storage/stub/17.webp deleted file mode 100644 index 7df45c3..0000000 Binary files a/storage/stub/17.webp and /dev/null differ diff --git a/storage/stub/19.webp b/storage/stub/19.webp deleted file mode 100644 index 7e77c30..0000000 Binary files a/storage/stub/19.webp and /dev/null differ diff --git a/storage/stub/image1.png b/storage/stub/image1.png deleted file mode 100644 index 977f4e2..0000000 Binary files a/storage/stub/image1.png and /dev/null differ