mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-12-02 17:47:58 +01:00
23 lines
620 B
PHP
23 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;
|
||
|
}
|
||
|
}
|