mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
controller refactoring part 24
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Users\Controllers;
|
||||
|
||||
|
||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||
|
||||
class GetAvatarController
|
||||
{
|
||||
@@ -15,8 +12,7 @@ class GetAvatarController
|
||||
*/
|
||||
public function __invoke(
|
||||
string $basename
|
||||
): StreamedResponse|FileNotFoundException {
|
||||
|
||||
): StreamedResponse | FileNotFoundException {
|
||||
// Check if file exist
|
||||
if (! Storage::exists("/avatars/$basename")) {
|
||||
abort(404);
|
||||
@@ -25,4 +21,4 @@ class GetAvatarController
|
||||
// Return avatar
|
||||
return Storage::download("/avatars/$basename", $basename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user