kopia lustrzana https://github.com/pixelfed/pixelfed
				
				
				
			Update InternalApiController
							rodzic
							
								
									aabfa6c099
								
							
						
					
					
						commit
						97bd7c7612
					
				|  | @ -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); | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Daniel Supernault
						Daniel Supernault