0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-15 13:10:29 +00:00

Cleaned up logic within ImageRepo

- Moved out extension check to ImageService as that seems more relevant.
- Updated models to use static-style references instead of facade to align with common modern usage within the app.
- Updated custom image_extension validation rule to use shared logic in image service.
This commit is contained in:
Dan Brown 2021-11-01 00:24:42 +00:00
parent 43830a372f
commit c7fea8fe08
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
5 changed files with 25 additions and 38 deletions
app/Http/Controllers/Images

View file

@ -9,27 +9,19 @@ use BookStack\Uploads\Image;
use BookStack\Uploads\ImageRepo;
use BookStack\Uploads\ImageService;
use Exception;
use Illuminate\Filesystem\Filesystem as File;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Validation\ValidationException;
use League\Flysystem\Util;
class ImageController extends Controller
{
protected $image;
protected $file;
protected $imageRepo;
protected $imageService;
/**
* ImageController constructor.
*/
public function __construct(Image $image, File $file, ImageRepo $imageRepo, ImageService $imageService)
public function __construct(ImageRepo $imageRepo, ImageService $imageService)
{
$this->image = $image;
$this->file = $file;
$this->imageRepo = $imageRepo;
$this->imageService = $imageService;
}