mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-03 08:41:29 +01:00
20 lines
No EOL
440 B
PHP
20 lines
No EOL
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);
|
|
}
|
|
} |