1
0
Fork 0
forked from mirror/pixelfed

Update InternalApiController

This commit is contained in:
Daniel Supernault 2019-02-07 12:01:01 -07:00
parent aabfa6c099
commit 97bd7c7612
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\{
DirectMessage,
DiscoverCategory,
Hashtag,
Follower,
Like,
@ -286,4 +287,17 @@ class InternalApiController extends Controller
{
}
public function discoverCategories(Request $request)
{
$categories = DiscoverCategory::whereActive(true)->orderBy('order')->take(10)->get();
$res = $categories->map(function($item) {
return [
'name' => $item->name,
'url' => $item->url(),
'thumb' => $item->thumb()
];
});
return response()->json($res);
}
}