19 lines
475 B
PHP
19 lines
475 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Models\MultimediaCategory;
|
|
use App\Transformers\MediaTransformer;
|
|
|
|
class MultimediaController extends ApiController
|
|
{
|
|
public function index($category)
|
|
{
|
|
$medias = MultimediaCategory::where('id', $category)->with('medias')->get()->first();
|
|
if($medias){
|
|
return $this->respondWithCollection($medias->medias, new MediaTransformer());
|
|
}
|
|
return $this->errorNotFound();
|
|
}
|
|
}
|