🎨 Add logo field to meetups API responses and fetch media relations for meetups

- ✏️ Updated `MeetupController` to include `with('media')` for meetups query.
- 🖼️ Added `logo` to `MeetupResource` via `getFirstMediaUrl`.
- 🧪 Extended feature tests to validate `logo` presence and type in API responses.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-13 22:56:10 +02:00
parent 8d7b1515d8
commit d07b141b40
3 changed files with 7 additions and 0 deletions
@@ -115,6 +115,7 @@ class MeetupController extends Controller
$meetups = $request->user()
->meetups()
->with('media')
->orderBy('name')
->get();
+1
View File
@@ -32,6 +32,7 @@ class MeetupResource extends JsonResource
'community' => $this->community,
'visible_on_map' => $this->visible_on_map,
'is_active' => $this->is_active,
'logo' => $this->getFirstMediaUrl('logo', 'thumb'),
'last_event_at' => $this->last_event_at,
'created_by' => $this->created_by,
'created_at' => $this->created_at,
+5
View File
@@ -87,6 +87,11 @@ it('returns the dashboard-selected meetups in mine index', function () {
expect($ids)
->toContain(...$selected->pluck('id')->all())
->not->toContain($unselected->id);
collect($response->json('data'))->each(
fn ($meetup) => expect($meetup)->toHaveKey('logo')
->and($meetup['logo'])->toBeString()
);
});
it('lets a pivot member view in mine show', function () {