forked from mirror/pixelfed
Update InternalApiController
This commit is contained in:
parent
aabfa6c099
commit
97bd7c7612
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue