mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-17 02:24:22 +01:00
20 lines
440 B
PHP
20 lines
440 B
PHP
|
<?php
|
||
|
|
||
|
use Entities\Image;
|
||
|
use Entities\Track;
|
||
|
use Illuminate\Support\Facades\App;
|
||
|
|
||
|
class ImagesController extends Controller {
|
||
|
public function getImage($id, $type) {
|
||
|
$coverType = Image::GetImageTypeFromName($type);
|
||
|
|
||
|
if ($coverType == null)
|
||
|
App::abort(404);
|
||
|
|
||
|
$image = Image::find($id);
|
||
|
if (!$image)
|
||
|
App::abort(404);
|
||
|
|
||
|
return File::inline($image->getFile($coverType['id']), $image->mime, $image->filename);
|
||
|
}
|
||
|
}
|