**Add authenticated API endpoints for managing Meetups, Cities, Venues, and Lecturers**

-  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.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-08 01:58:37 +02:00
parent 7510946f38
commit 3b93e22e95
33 changed files with 1515 additions and 68 deletions
@@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests\Api;
use Illuminate\Foundation\Http\FormRequest;
class UpdateLecturerRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user()->can('update', $this->route('lecturer'));
}
/**
* @return array<string, array<int, string>>
*/
public function rules(): array
{
return [
'name' => ['sometimes', 'required', 'string', 'max:255'],
'subtitle' => ['sometimes', 'nullable', 'string'],
'intro' => ['sometimes', 'nullable', 'string'],
'description' => ['sometimes', 'nullable', 'string'],
'active' => ['sometimes', 'boolean'],
'website' => ['sometimes', 'nullable', 'url', 'max:255'],
'twitter_username' => ['sometimes', 'nullable', 'string', 'max:255'],
'nostr' => ['sometimes', 'nullable', 'string', 'max:255'],
'lightning_address' => ['sometimes', 'nullable', 'string', 'max:255'],
'lnurl' => ['sometimes', 'nullable', 'string'],
'node_id' => ['sometimes', 'nullable', 'string', 'max:255'],
'paynym' => ['sometimes', 'nullable', 'string'],
'team_id' => ['sometimes', 'nullable', 'integer', 'exists:teams,id'],
];
}
/**
* @return array<string, string>
*/
public function messages(): array
{
return [
'team_id.exists' => 'Das angegebene Team existiert nicht.',
];
}
}