mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-11 02:50:29 +00:00
✨ **Enhance API functionality and localizations**
- 🌐 Added API documentation annotations for multiple controllers (Meetups, Cities, Countries, Courses, Highscores, Venues), improving public and developer-facing endpoint clarity. - ➕ Integrated and configured the `dedoc/scramble` package for automated OpenAPI documentation generation. - 🔒 Excluded internal routes and actions from API documentation using `ExcludeRouteFromDocs` attributes. - 🌍 Added new localization keys for API Token features across multiple languages (`lv`, `es`, etc.). - 🛠️ Introduced `Group`, `Response`, and `QueryParameter` attributes for better request descriptions and structured documentation. - 🚀 Enhanced functionality for listing operations in controllers with filters and query parameters like `search` and `selected`.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\LibraryItem;
|
||||
use Dedoc\Scramble\Attributes\Group;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
#[Group(name: 'Community', weight: 7)]
|
||||
class BindleController extends Controller
|
||||
{
|
||||
/**
|
||||
* Bindles (Bibliotheks-Einträge) auflisten
|
||||
*
|
||||
* Liefert die Bibliothekseinträge vom Typ 'bindle' mit id, name, link und image.
|
||||
*
|
||||
* @return Collection<int, array{id: int, name: string, link: string, image: string}>
|
||||
*/
|
||||
public function __invoke(): Collection
|
||||
{
|
||||
return LibraryItem::query()
|
||||
->where('type', 'bindle')
|
||||
->with([
|
||||
'media',
|
||||
])
|
||||
->orderByDesc('id')
|
||||
->get()
|
||||
->map(fn ($item) => [
|
||||
'id' => $item->id,
|
||||
'name' => $item->name,
|
||||
'link' => strtok($item->value, '?'),
|
||||
'image' => $item->getFirstMediaUrl('main'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user