mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-11 14:50:30 +00:00
3b93e22e95
- ➕ Introduced `store`, `update`, `mine`, and `mineShow` endpoints for `Meetups`, `Cities`, `Venues`, and `Lecturers` with validation and authorization. - 🔒 Added `Policies` for `Meetups`, `Cities`, `Venues`, and `Lecturers` leveraging `ChecksCreatorOwnership` for ownership checks. - 🌐 Created `Resources` for structured API responses: `MeetupResource`, `CityResource`, `VenueResource`, and `LecturerResource`. - ✅ Added dedicated `Request` classes for input validation: `Store` and `Update` variants for all models. - 🛠️ Updated controllers to support new functionalities with localized error messages and proper HTTP responses.
42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Meetup;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/**
|
|
* @mixin Meetup
|
|
*/
|
|
class MeetupResource extends JsonResource
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
'slug' => $this->slug,
|
|
'city_id' => $this->city_id,
|
|
'intro' => $this->intro,
|
|
'telegram_link' => $this->telegram_link,
|
|
'webpage' => $this->webpage,
|
|
'twitter_username' => $this->twitter_username,
|
|
'matrix_group' => $this->matrix_group,
|
|
'nostr' => $this->nostr,
|
|
'simplex' => $this->simplex,
|
|
'signal' => $this->signal,
|
|
'community' => $this->community,
|
|
'visible_on_map' => $this->visible_on_map,
|
|
'is_active' => $this->is_active,
|
|
'last_event_at' => $this->last_event_at,
|
|
'created_by' => $this->created_by,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
];
|
|
}
|
|
}
|