Pony.fm/app/Http/Controllers/Api/Web/ReportController.php
2017-05-19 11:22:14 +01:00

22 lines
620 B
PHP

<?php
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
use Response;
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
use Poniverse\Ponyfm\Models\Report;
class ReportController extends ApiControllerBase
{
public function getReportCategories($type) {
$type_id = Report::getResourceTypeIdFromString($type);
$categories = Report::getCategories($type_id);
return Response::json(['categories' => $categories]);
}
public function getReports() {
$reports = Report::all();
$reports[0]['type_string'] = $reports[0]->resource();
return $reports;
}
}