/** * @param $id * @return mixed */ public function getMediaById($id) { try { return $this->repository->findById($id); } catch (\CoandaCMS\Coanda\Media\Exceptions\MediaNotFound $exception) { return false; } }
/** * @return mixed */ public function getBrowse() { $per_page = 12; $type = 'all'; if (Input::has('type') && Input::get('type') == 'image') { $type = 'image'; } if (Input::has('type') && Input::get('type') == 'file') { $type = 'file'; } $media_list = $this->mediaRepository->getListByType($type, $per_page); return $media_list; }