Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
8
app/Http/Controllers/Controller.php
Normal file
8
app/Http/Controllers/Controller.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
abstract class Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
15
app/Http/Controllers/DashboardController.php
Normal file
15
app/Http/Controllers/DashboardController.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request): Response
|
||||
{
|
||||
return Inertia::render('Dashboard');
|
||||
}
|
||||
}
|
||||
32
app/Http/Controllers/PeopleController.php
Normal file
32
app/Http/Controllers/PeopleController.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class PeopleController extends Controller
|
||||
{
|
||||
public function show(User $user): Response
|
||||
{
|
||||
abort_unless($user->is_active, 404);
|
||||
|
||||
return Inertia::render('Profile/Show', [
|
||||
'person' => [
|
||||
'id' => $user->id,
|
||||
'name' => $user->name,
|
||||
'initials' => $user->initials,
|
||||
'email' => $user->email,
|
||||
'job_title' => $user->job_title,
|
||||
'department' => $user->department,
|
||||
'location' => $user->location,
|
||||
'phone' => $user->phone,
|
||||
'mobile' => $user->mobile,
|
||||
'about' => $user->about,
|
||||
'avatar_url' => $user->avatarUrl(256),
|
||||
],
|
||||
'isOwnProfile' => $user->is(auth()->user()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
75
app/Http/Controllers/ProfileController.php
Normal file
75
app/Http/Controllers/ProfileController.php
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\UpdateProfileRequest;
|
||||
use App\Models\User;
|
||||
use App\Support\Avatars;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\Rules\File;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
public function show(Request $request): RedirectResponse
|
||||
{
|
||||
return to_route('people.show', $request->user());
|
||||
}
|
||||
|
||||
public function edit(Request $request): Response
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
return Inertia::render('Profile/Edit', [
|
||||
'profile' => [
|
||||
...$user->only([
|
||||
'first_name', 'last_name', 'email', 'job_title', 'department',
|
||||
'location', 'phone', 'mobile', 'about', 'theme',
|
||||
]),
|
||||
'name' => $user->name,
|
||||
'initials' => $user->initials,
|
||||
'avatar_url' => $user->avatarUrl(256),
|
||||
'has_password' => $user->password !== null,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(UpdateProfileRequest $request): RedirectResponse
|
||||
{
|
||||
$request->user()->update($request->validated());
|
||||
|
||||
return back()->with('status', 'profile-updated');
|
||||
}
|
||||
|
||||
public function updateAvatar(Request $request, Avatars $avatars): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'avatar' => ['required', File::image()->types(['jpg', 'jpeg', 'png', 'webp'])->max(8 * 1024)],
|
||||
]);
|
||||
|
||||
$avatars->store($request->user(), $request->file('avatar'));
|
||||
|
||||
return back()->with('status', 'avatar-updated');
|
||||
}
|
||||
|
||||
public function destroyAvatar(Request $request, Avatars $avatars): RedirectResponse
|
||||
{
|
||||
$avatars->delete($request->user());
|
||||
|
||||
return back()->with('status', 'avatar-deleted');
|
||||
}
|
||||
|
||||
public function updateTheme(Request $request): RedirectResponse
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'theme' => ['required', Rule::in(User::THEMES)],
|
||||
]);
|
||||
|
||||
$request->user()->update($validated);
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
42
app/Http/Middleware/HandleInertiaRequests.php
Normal file
42
app/Http/Middleware/HandleInertiaRequests.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\Branding;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Middleware;
|
||||
|
||||
class HandleInertiaRequests extends Middleware
|
||||
{
|
||||
protected $rootView = 'app';
|
||||
|
||||
public function __construct(private readonly Branding $branding) {}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function share(Request $request): array
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
return [
|
||||
...parent::share($request),
|
||||
'branding' => $this->branding->toArray(),
|
||||
'auth' => [
|
||||
'user' => $user ? [
|
||||
'id' => $user->id,
|
||||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
'initials' => $user->initials,
|
||||
'job_title' => $user->job_title,
|
||||
'avatar_url' => $user->avatarUrl(96),
|
||||
'theme' => $user->theme,
|
||||
'is_admin' => $user->is_admin,
|
||||
] : null,
|
||||
],
|
||||
'flash' => [
|
||||
'status' => fn () => $request->session()->get('status'),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
48
app/Http/Requests/UpdateProfileRequest.php
Normal file
48
app/Http/Requests/UpdateProfileRequest.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateProfileRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'first_name' => ['required', 'string', 'max:100'],
|
||||
'last_name' => ['required', 'string', 'max:100'],
|
||||
'email' => [
|
||||
'required', 'string', 'lowercase', 'email', 'max:255',
|
||||
Rule::unique('users')->ignore($this->user()->id),
|
||||
],
|
||||
'job_title' => ['nullable', 'string', 'max:150'],
|
||||
'department' => ['nullable', 'string', 'max:150'],
|
||||
'location' => ['nullable', 'string', 'max:150'],
|
||||
'phone' => ['nullable', 'string', 'max:50'],
|
||||
'mobile' => ['nullable', 'string', 'max:50'],
|
||||
'about' => ['nullable', 'string', 'max:2000'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'first_name' => 'Vorname',
|
||||
'last_name' => 'Nachname',
|
||||
'email' => 'E-Mail-Adresse',
|
||||
'job_title' => 'Funktion',
|
||||
'department' => 'Abteilung',
|
||||
'location' => 'Standort',
|
||||
'phone' => 'Telefon',
|
||||
'mobile' => 'Mobil',
|
||||
'about' => 'Über mich',
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue