Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
89b35ac480
commit
2035c46edd
130 files changed
+18519
-50
No files matched your search
@@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[{compose,docker-compose}.{yml,yaml}]
|
||||
indent_size = 4
|
||||
@@ -0,0 +1,70 @@
|
||||
APP_NAME="Lara und Felix"
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost:8000
|
||||
|
||||
APP_LOCALE=de
|
||||
APP_FALLBACK_LOCALE=de
|
||||
APP_FAKER_LOCALE=de_DE
|
||||
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
# APP_MAINTENANCE_STORE=database
|
||||
|
||||
# PHP_CLI_SERVER_WORKERS=4
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
|
||||
CACHE_STORE=database
|
||||
# CACHE_PREFIX=
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_CLIENT=phpredis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=log
|
||||
MAIL_SCHEME=null
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
|
||||
# Im Container: /media/public, /media/derived, /media/originals. Lokal: Standard unter storage/.
|
||||
MEDIA_PUBLIC_PATH=
|
||||
MEDIA_DERIVED_PATH=
|
||||
MEDIA_ORIGINALS_PATH=
|
||||
+11
-9
@@ -1,9 +1,11 @@
|
||||
# Einheitliche Zeilenenden: Linux-Ziele (Docker, Runner) brauchen LF, auch wenn unter Windows eingecheckt wird.
|
||||
* text=auto
|
||||
*.sh text eol=lf
|
||||
Dockerfile text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.yaml text eol=lf
|
||||
*.conf text eol=lf
|
||||
*.php text eol=lf
|
||||
*.md text eol=lf
|
||||
* text=auto eol=lf
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
.styleci.yml export-ignore
|
||||
+29
-18
@@ -1,24 +1,35 @@
|
||||
node_modules/
|
||||
vendor/
|
||||
*.log
|
||||
.DS_Store
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
dist/
|
||||
public/build/
|
||||
public/hot/
|
||||
public/storage
|
||||
storage/*.key
|
||||
storage/logs/
|
||||
storage/framework/cache/
|
||||
storage/framework/sessions/
|
||||
storage/framework/views/
|
||||
bootstrap/cache/*.php
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpactor.json
|
||||
.phpunit.result.cache
|
||||
.phpunit.cache/
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
/.codex
|
||||
/.idea
|
||||
/.nova
|
||||
/.phpunit.cache
|
||||
/.vscode
|
||||
/.zed
|
||||
/auth.json
|
||||
/node_modules
|
||||
/public/build
|
||||
/public/css/filament
|
||||
/public/fonts-manifest.dev.json
|
||||
/public/fonts/filament
|
||||
/public/hot
|
||||
/public/js/filament
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/storage/pail
|
||||
/storage/logs/
|
||||
/vendor
|
||||
/database/*.sqlite*
|
||||
/tmp-laravel/
|
||||
/composer.phar
|
||||
_ide_helper.php
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
auth.json
|
||||
composer.phar
|
||||
/tmp-laravel/
|
||||
Thumbs.db
|
||||
+2
-1
@@ -20,7 +20,8 @@ FROM base AS vendor
|
||||
COPY composer.json composer.lock ./
|
||||
RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --no-interaction
|
||||
COPY . .
|
||||
RUN composer dump-autoload --no-dev --optimize --no-interaction
|
||||
RUN composer dump-autoload --no-dev --optimize --no-interaction \
|
||||
&& APP_KEY=base64:MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY= php artisan filament:assets --ansi --no-interaction
|
||||
|
||||
# ---- Frontend-Assets (Filament-Theme braucht vendor/) ----------------------------------------
|
||||
FROM node:22-alpine AS assets
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Lara & Felix – Stark im Alltag
|
||||
|
||||
Laravel-13-Anwendung mit Filament 5 und PostgreSQL.
|
||||
|
||||
Gearbeitet wird auf `develop`. Ein Push auf `develop` testet und deployt auf die Testumgebung. `main` ist Produktion und wird nicht direkt beschrieben. Die Betriebsregeln stehen in `CLAUDE.md`.
|
||||
|
||||
Lokal: `composer install`, `.env` aus `.env.example`, `php artisan key:generate`, `php artisan migrate`, `npm install`, `npm run build`, `php artisan test`.
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Domain\Identity\AssignStaffRoles;
|
||||
use App\Domain\Identity\RegisterAccount;
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateStaffUser extends Command
|
||||
{
|
||||
protected $signature = 'luf:personal {email} {--role=systemverwalter} {--name=Personal}';
|
||||
|
||||
protected $description = 'Legt ein bestätigtes Personalkonto an und gibt das Passwort einmal aus';
|
||||
|
||||
public function handle(RegisterAccount $register, AssignStaffRoles $assign): int
|
||||
{
|
||||
$role = StaffRole::tryFrom((string) $this->option('role'));
|
||||
|
||||
if ($role === null) {
|
||||
$this->error('Unbekannte Rolle.');
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
$password = Str::password(20);
|
||||
$user = $register->register((string) $this->option('name'), (string) $this->argument('email'), $password, true);
|
||||
$user->markEmailAsVerified();
|
||||
$assign->sync($user, [$role->value], $user);
|
||||
|
||||
$this->info('Konto angelegt. Passwort (nur diese Ausgabe):');
|
||||
$this->line($password);
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms\Blocks;
|
||||
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class BlockRegistry
|
||||
{
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function labels(): array
|
||||
{
|
||||
return [
|
||||
'heading' => 'Überschrift und Einleitung',
|
||||
'prose' => 'Fließtext',
|
||||
'image_text' => 'Bild und Text',
|
||||
'call_to_action' => 'Handlungsaufruf',
|
||||
'cards' => 'Karten',
|
||||
'faq' => 'FAQ',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array<string, mixed>> $blocks
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function normalize(array $blocks): array
|
||||
{
|
||||
$normalized = [];
|
||||
|
||||
foreach (array_values($blocks) as $index => $block) {
|
||||
if (! is_array($block)) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index" => 'Ein Baustein ist unvollständig.',
|
||||
]);
|
||||
}
|
||||
|
||||
$type = $block['type'] ?? null;
|
||||
|
||||
if (! is_string($type) || ! array_key_exists($type, $this->labels())) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index.type" => 'Dieser Bausteintyp ist nicht freigegeben.',
|
||||
]);
|
||||
}
|
||||
|
||||
$normalized[] = $this->normalizeOne($type, $block, $index);
|
||||
}
|
||||
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $block
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function normalizeOne(string $type, array $block, int $index): array
|
||||
{
|
||||
$rules = match ($type) {
|
||||
'heading' => [
|
||||
'heading' => ['required', 'string', 'max:200'],
|
||||
'intro' => ['nullable', 'string', 'max:1000'],
|
||||
],
|
||||
'prose' => [
|
||||
'body' => ['required', 'string', 'max:20000'],
|
||||
],
|
||||
'image_text' => [
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'alt' => ['required', 'string', 'max:300'],
|
||||
'body' => ['required', 'string', 'max:5000'],
|
||||
],
|
||||
'call_to_action' => [
|
||||
'heading' => ['required', 'string', 'max:200'],
|
||||
'text' => ['nullable', 'string', 'max:1000'],
|
||||
'label' => ['required', 'string', 'max:80'],
|
||||
'url' => ['required', 'string', 'max:500'],
|
||||
],
|
||||
'cards' => [
|
||||
'items' => ['required', 'array', 'min:1', 'max:6'],
|
||||
'items.*.title' => ['required', 'string', 'max:120'],
|
||||
'items.*.text' => ['nullable', 'string', 'max:500'],
|
||||
'items.*.url' => ['nullable', 'string', 'max:500'],
|
||||
],
|
||||
'faq' => [
|
||||
'items' => ['required', 'array', 'min:1', 'max:20'],
|
||||
'items.*.question' => ['required', 'string', 'max:300'],
|
||||
'items.*.answer' => ['required', 'string', 'max:2000'],
|
||||
],
|
||||
default => [],
|
||||
};
|
||||
|
||||
$validator = Validator::make($block, $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$messages = [];
|
||||
|
||||
foreach ($validator->errors()->messages() as $key => $errors) {
|
||||
$messages["blocks.$index.$key"] = $errors;
|
||||
}
|
||||
|
||||
throw ValidationException::withMessages($messages);
|
||||
}
|
||||
|
||||
$clean = ['type' => $type];
|
||||
|
||||
foreach (array_keys($rules) as $key) {
|
||||
if (str_contains($key, '.*')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$clean[$key] = $block[$key] ?? null;
|
||||
}
|
||||
|
||||
if ($type === 'image_text') {
|
||||
$clean['image'] = $this->imagePath($clean['image'] ?? null, $index);
|
||||
}
|
||||
|
||||
if (in_array($type, ['call_to_action', 'cards'], true)) {
|
||||
$clean = $this->assertSafeUrls($clean, $index);
|
||||
}
|
||||
|
||||
return $clean;
|
||||
}
|
||||
|
||||
private function imagePath(mixed $image, int $index): ?string
|
||||
{
|
||||
if (is_array($image)) {
|
||||
$image = $image[0] ?? null;
|
||||
}
|
||||
|
||||
if ($image === null || $image === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (! is_string($image) || str_contains($image, '..') || ! str_starts_with($image, 'cms/')) {
|
||||
throw ValidationException::withMessages([
|
||||
"blocks.$index.image" => 'Das Bild liegt nicht im öffentlichen Medienbereich.',
|
||||
]);
|
||||
}
|
||||
|
||||
return $image;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $block
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function assertSafeUrls(array $block, int $index): array
|
||||
{
|
||||
if (array_key_exists('url', $block)) {
|
||||
$block['url'] = $this->safeUrl($block['url'], "blocks.$index.url");
|
||||
}
|
||||
|
||||
if (isset($block['items']) && is_array($block['items'])) {
|
||||
foreach ($block['items'] as $itemIndex => $item) {
|
||||
if (is_array($item) && filled($item['url'] ?? null)) {
|
||||
$block['items'][$itemIndex]['url'] = $this->safeUrl($item['url'], "blocks.$index.items.$itemIndex.url");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $block;
|
||||
}
|
||||
|
||||
private function safeUrl(mixed $url, string $key): string
|
||||
{
|
||||
if (! is_string($url)) {
|
||||
throw ValidationException::withMessages([$key => 'Die Adresse ist ungültig.']);
|
||||
}
|
||||
|
||||
$isRelative = str_starts_with($url, '/') && ! str_starts_with($url, '//');
|
||||
$isAbsolute = preg_match('#^https?://#i', $url) === 1;
|
||||
|
||||
if (! $isRelative && ! $isAbsolute) {
|
||||
throw ValidationException::withMessages([$key => 'Erlaubt sind Seitenpfade oder http(s)-Adressen.']);
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class NavigationItem extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'label',
|
||||
'page_id',
|
||||
'url',
|
||||
'placement',
|
||||
'sort_order',
|
||||
];
|
||||
|
||||
public function page(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Page::class);
|
||||
}
|
||||
|
||||
public function href(): ?string
|
||||
{
|
||||
if ($this->page !== null) {
|
||||
return $this->page->path === '/' ? url('/') : url($this->page->path);
|
||||
}
|
||||
|
||||
if ($this->url === null || $this->url === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (str_starts_with($this->url, '/') && ! str_starts_with($this->url, '//')) {
|
||||
return url($this->url);
|
||||
}
|
||||
|
||||
return $this->url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Models\User;
|
||||
|
||||
class NavigationItemPolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->hasStaffRole(StaffRole::Redakteur);
|
||||
}
|
||||
|
||||
public function view(User $user, NavigationItem $item): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function update(User $user, NavigationItem $item): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function delete(User $user, NavigationItem $item): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class Page extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'path',
|
||||
];
|
||||
|
||||
public function revisions(): HasMany
|
||||
{
|
||||
return $this->hasMany(PageRevision::class)->latest('id');
|
||||
}
|
||||
|
||||
public function publishedRevision(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PageRevision::class, 'published_revision_id');
|
||||
}
|
||||
|
||||
public function latestRevision(): HasOne
|
||||
{
|
||||
return $this->hasOne(PageRevision::class)->latestOfMany();
|
||||
}
|
||||
|
||||
public function navigationItems(): HasMany
|
||||
{
|
||||
return $this->hasMany(NavigationItem::class);
|
||||
}
|
||||
|
||||
public function isPublished(): bool
|
||||
{
|
||||
return $this->published_revision_id !== null;
|
||||
}
|
||||
|
||||
public function publicUrl(): string
|
||||
{
|
||||
return $this->path === '/' ? url('/') : url($this->path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Models\User;
|
||||
|
||||
class PagePolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->hasStaffRole(StaffRole::Redakteur);
|
||||
}
|
||||
|
||||
public function view(User $user, Page $page): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function update(User $user, Page $page): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function publish(User $user, Page $page): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function delete(User $user, Page $page): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PageRevision extends Model
|
||||
{
|
||||
public const UPDATED_AT = null;
|
||||
|
||||
protected $fillable = [
|
||||
'page_id',
|
||||
'blocks',
|
||||
'seo_title',
|
||||
'seo_description',
|
||||
'created_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'blocks' => 'array',
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function page(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Page::class);
|
||||
}
|
||||
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Cms;
|
||||
|
||||
use App\Domain\Cms\Blocks\BlockRegistry;
|
||||
use App\Jobs\PublishPublicMedia;
|
||||
use App\Models\User;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class PageService
|
||||
{
|
||||
public function __construct(private readonly BlockRegistry $blocks) {}
|
||||
|
||||
/**
|
||||
* @param list<array<string, mixed>> $blocks
|
||||
*/
|
||||
public function saveRevision(Page $page, array $blocks, ?string $seoTitle, ?string $seoDescription, ?User $author): PageRevision
|
||||
{
|
||||
$normalized = $this->blocks->normalize($blocks);
|
||||
|
||||
$revision = $page->revisions()->create([
|
||||
'blocks' => $normalized,
|
||||
'seo_title' => $seoTitle !== null && $seoTitle !== '' ? $seoTitle : null,
|
||||
'seo_description' => $seoDescription !== null && $seoDescription !== '' ? $seoDescription : null,
|
||||
'created_by' => $author?->id,
|
||||
]);
|
||||
|
||||
foreach ($normalized as $block) {
|
||||
if (($block['type'] ?? null) === 'image_text' && filled($block['image'] ?? null)) {
|
||||
PublishPublicMedia::dispatch($block['image']);
|
||||
}
|
||||
}
|
||||
|
||||
return $revision;
|
||||
}
|
||||
|
||||
public function publish(Page $page, PageRevision $revision): void
|
||||
{
|
||||
if ($revision->page_id !== $page->id) {
|
||||
throw ValidationException::withMessages([
|
||||
'revision' => 'Die Revision gehört zu einer anderen Seite.',
|
||||
]);
|
||||
}
|
||||
|
||||
$page->published_revision_id = $revision->id;
|
||||
$page->save();
|
||||
}
|
||||
|
||||
public function restore(Page $page, PageRevision $source, ?User $author): PageRevision
|
||||
{
|
||||
if ($source->page_id !== $page->id) {
|
||||
throw ValidationException::withMessages([
|
||||
'revision' => 'Die Revision gehört zu einer anderen Seite.',
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->saveRevision(
|
||||
$page,
|
||||
$source->blocks,
|
||||
$source->seo_title,
|
||||
$source->seo_description,
|
||||
$author,
|
||||
);
|
||||
}
|
||||
|
||||
public function normalizePath(string $path): string
|
||||
{
|
||||
$path = '/'.trim($path, '/');
|
||||
|
||||
if ($path === '/') {
|
||||
return '/';
|
||||
}
|
||||
|
||||
$path = mb_strtolower($path);
|
||||
|
||||
if (preg_match('#^/[a-z0-9]+(?:-[a-z0-9]+)*$#', $path) !== 1) {
|
||||
throw ValidationException::withMessages([
|
||||
'path' => 'Der Pfad darf nur Kleinbuchstaben, Ziffern und Bindestriche enthalten.',
|
||||
]);
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
enum AccountStatus: string
|
||||
{
|
||||
case Aktiv = 'aktiv';
|
||||
case Gesperrt = 'gesperrt';
|
||||
case Geloescht = 'geloescht';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Aktiv => 'Aktiv',
|
||||
self::Gesperrt => 'Gesperrt',
|
||||
self::Geloescht => 'Gelöscht',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class AssignStaffRoles
|
||||
{
|
||||
/**
|
||||
* @param list<string> $roles
|
||||
*/
|
||||
public function sync(User $user, array $roles, User $actor): void
|
||||
{
|
||||
$roles = array_values(array_unique($roles));
|
||||
|
||||
foreach ($roles as $role) {
|
||||
if (StaffRole::tryFrom($role) === null) {
|
||||
throw ValidationException::withMessages([
|
||||
'roles' => 'Unbekannte Personalrolle.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
$actor->hasStaffRole(StaffRole::Systemverwalter)
|
||||
&& $user->is($actor)
|
||||
&& ! in_array(StaffRole::Systemverwalter->value, $roles, true)
|
||||
) {
|
||||
throw ValidationException::withMessages([
|
||||
'roles' => 'Das eigene Systemverwalter-Recht bleibt bestehen.',
|
||||
]);
|
||||
}
|
||||
|
||||
DB::transaction(function () use ($user, $roles): void {
|
||||
$user->staffRoles()->delete();
|
||||
|
||||
foreach ($roles as $role) {
|
||||
$user->staffRoles()->create(['role' => $role]);
|
||||
}
|
||||
});
|
||||
|
||||
$user->unsetRelation('staffRoles');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class Party extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'display_name',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'type' => PartyType::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function user(): HasOne
|
||||
{
|
||||
return $this->hasOne(User::class);
|
||||
}
|
||||
|
||||
public function profile(): HasOne
|
||||
{
|
||||
return $this->hasOne(Profile::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
enum PartyType: string
|
||||
{
|
||||
case Person = 'person';
|
||||
case Organisation = 'organisation';
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Profile extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'party_id',
|
||||
'display_name',
|
||||
'visibility',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'visibility' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
public function party(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Party::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class RegisterAccount
|
||||
{
|
||||
public function register(string $name, string $email, string $password, bool $adult): User
|
||||
{
|
||||
if (! $adult) {
|
||||
throw ValidationException::withMessages([
|
||||
'adult' => 'Die Plattform richtet sich an Erwachsene. Ein Konto setzt die Bestätigung voraus.',
|
||||
]);
|
||||
}
|
||||
|
||||
return DB::transaction(function () use ($name, $email, $password): User {
|
||||
$party = Party::query()->create([
|
||||
'type' => PartyType::Person,
|
||||
'display_name' => $name,
|
||||
]);
|
||||
|
||||
Profile::query()->create([
|
||||
'party_id' => $party->id,
|
||||
'display_name' => $name,
|
||||
'visibility' => ['display_name' => 'private'],
|
||||
]);
|
||||
|
||||
return User::query()->create([
|
||||
'party_id' => $party->id,
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'password' => $password,
|
||||
'status' => AccountStatus::Aktiv,
|
||||
'confirmed_adult_at' => now(),
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
enum StaffRole: string
|
||||
{
|
||||
case Redakteur = 'redakteur';
|
||||
case Fachpruefer = 'fachpruefer';
|
||||
case Katalogverwalter = 'katalogverwalter';
|
||||
case Kundenbetreuung = 'kundenbetreuung';
|
||||
case Verifikationspruefer = 'verifikationspruefer';
|
||||
case Moderator = 'moderator';
|
||||
case Systemverwalter = 'systemverwalter';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Redakteur => 'Redakteur',
|
||||
self::Fachpruefer => 'Fachprüfer',
|
||||
self::Katalogverwalter => 'Katalogverwalter',
|
||||
self::Kundenbetreuung => 'Kundenbetreuung',
|
||||
self::Verifikationspruefer => 'Verifikationsprüfer',
|
||||
self::Moderator => 'Moderator',
|
||||
self::Systemverwalter => 'Systemverwalter',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function options(): array
|
||||
{
|
||||
$options = [];
|
||||
|
||||
foreach (self::cases() as $role) {
|
||||
$options[$role->value] = $role->label();
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Identity;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class StaffRoleAssignment extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'role',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'role' => StaffRole::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\NavigationItems;
|
||||
|
||||
use App\Domain\Cms\NavigationItem;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Filament\Resources\NavigationItems\Pages\ManageNavigationItems;
|
||||
use Closure;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class NavigationItemResource extends Resource
|
||||
{
|
||||
protected static ?string $model = NavigationItem::class;
|
||||
|
||||
protected static ?string $navigationLabel = 'Navigation';
|
||||
|
||||
protected static ?string $modelLabel = 'Navigationspunkt';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Navigation';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
TextInput::make('label')->label('Beschriftung')->required()->maxLength(80),
|
||||
Select::make('page_id')
|
||||
->label('Seite')
|
||||
->options(fn (): array => Page::query()->orderBy('path')->pluck('path', 'id')->all())
|
||||
->searchable(),
|
||||
TextInput::make('url')
|
||||
->label('Adresse')
|
||||
->maxLength(500)
|
||||
->rule(function (Get $get): Closure {
|
||||
return function (string $attribute, mixed $value, Closure $fail) use ($get): void {
|
||||
if (blank($get('page_id')) && blank($value)) {
|
||||
$fail('Wählen Sie eine Seite oder eine Adresse.');
|
||||
}
|
||||
};
|
||||
}),
|
||||
Select::make('placement')
|
||||
->label('Platz')
|
||||
->options([
|
||||
'header' => 'Kopfzeile',
|
||||
'footer' => 'Fußzeile',
|
||||
])
|
||||
->required(),
|
||||
TextInput::make('sort_order')->label('Reihenfolge')->numeric()->required()->default(0),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('label')->label('Beschriftung'),
|
||||
TextColumn::make('page.path')->label('Seite'),
|
||||
TextColumn::make('url')->label('Adresse'),
|
||||
TextColumn::make('placement')->label('Platz'),
|
||||
TextColumn::make('sort_order')->label('Reihenfolge')->sortable(),
|
||||
])
|
||||
->defaultSort('sort_order');
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ManageNavigationItems::route('/'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\NavigationItems\Pages;
|
||||
|
||||
use App\Filament\Resources\NavigationItems\NavigationItemResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ManageRecords;
|
||||
|
||||
class ManageNavigationItems extends ManageRecords
|
||||
{
|
||||
protected static string $resource = NavigationItemResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Pages;
|
||||
|
||||
use App\Domain\Cms\Blocks\BlockRegistry;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Filament\Resources\Pages\Pages\CreatePage;
|
||||
use App\Filament\Resources\Pages\Pages\EditPage;
|
||||
use App\Filament\Resources\Pages\Pages\ListPages;
|
||||
use App\Filament\Resources\Pages\RelationManagers\RevisionsRelationManager;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class PageResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Page::class;
|
||||
|
||||
protected static ?string $navigationLabel = 'Seiten';
|
||||
|
||||
protected static ?string $modelLabel = 'Seite';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Seiten';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'path';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
$labels = app(BlockRegistry::class)->labels();
|
||||
|
||||
return $schema->components([
|
||||
TextInput::make('path')
|
||||
->label('Pfad')
|
||||
->required()
|
||||
->maxLength(255)
|
||||
->helperText('Zum Beispiel / oder /praevention'),
|
||||
TextInput::make('seo_title')
|
||||
->label('SEO-Titel')
|
||||
->maxLength(255),
|
||||
Textarea::make('seo_description')
|
||||
->label('SEO-Beschreibung')
|
||||
->maxLength(500)
|
||||
->columnSpanFull(),
|
||||
Repeater::make('blocks')
|
||||
->label('Bausteine')
|
||||
->schema([
|
||||
Select::make('type')
|
||||
->label('Typ')
|
||||
->options($labels)
|
||||
->required()
|
||||
->live(),
|
||||
TextInput::make('heading')
|
||||
->label('Überschrift')
|
||||
->visible(fn (Get $get): bool => in_array($get('type'), ['heading', 'call_to_action'], true)),
|
||||
Textarea::make('intro')
|
||||
->label('Einleitung')
|
||||
->visible(fn (Get $get): bool => $get('type') === 'heading'),
|
||||
Textarea::make('body')
|
||||
->label('Text')
|
||||
->visible(fn (Get $get): bool => in_array($get('type'), ['prose', 'image_text'], true))
|
||||
->columnSpanFull(),
|
||||
FileUpload::make('image')
|
||||
->label('Bild')
|
||||
->disk('cms_incoming')
|
||||
->directory('cms')
|
||||
->image()
|
||||
->visible(fn (Get $get): bool => $get('type') === 'image_text'),
|
||||
TextInput::make('alt')
|
||||
->label('Alternativtext')
|
||||
->visible(fn (Get $get): bool => $get('type') === 'image_text'),
|
||||
Textarea::make('text')
|
||||
->label('Text')
|
||||
->visible(fn (Get $get): bool => $get('type') === 'call_to_action'),
|
||||
TextInput::make('label')
|
||||
->label('Beschriftung der Aktion')
|
||||
->visible(fn (Get $get): bool => $get('type') === 'call_to_action'),
|
||||
TextInput::make('url')
|
||||
->label('Adresse')
|
||||
->visible(fn (Get $get): bool => $get('type') === 'call_to_action'),
|
||||
Repeater::make('items')
|
||||
->label('Einträge')
|
||||
->visible(fn (Get $get): bool => in_array($get('type'), ['cards', 'faq'], true))
|
||||
->schema([
|
||||
TextInput::make('title')->label('Titel')->visible(fn (Get $get): bool => $get('../../type') === 'cards'),
|
||||
Textarea::make('text')->label('Text')->visible(fn (Get $get): bool => $get('../../type') === 'cards'),
|
||||
TextInput::make('url')->label('Adresse')->visible(fn (Get $get): bool => $get('../../type') === 'cards'),
|
||||
TextInput::make('question')->label('Frage')->visible(fn (Get $get): bool => $get('../../type') === 'faq'),
|
||||
Textarea::make('answer')->label('Antwort')->visible(fn (Get $get): bool => $get('../../type') === 'faq'),
|
||||
]),
|
||||
])
|
||||
->columnSpanFull()
|
||||
->reorderable()
|
||||
->collapsed(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('path')->label('Pfad')->searchable(),
|
||||
TextColumn::make('published_revision_id')
|
||||
->label('Veröffentlicht')
|
||||
->formatStateUsing(fn ($state): string => $state ? 'Ja' : 'Entwurf'),
|
||||
TextColumn::make('updated_at')->label('Geändert')->dateTime('d.m.Y H:i'),
|
||||
])
|
||||
->recordUrl(fn (Page $record): string => static::getUrl('edit', ['record' => $record]));
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RevisionsRelationManager::class,
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListPages::route('/'),
|
||||
'create' => CreatePage::route('/create'),
|
||||
'edit' => EditPage::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Pages\Pages;
|
||||
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Filament\Resources\Pages\PageResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CreatePage extends CreateRecord
|
||||
{
|
||||
protected static string $resource = PageResource::class;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function handleRecordCreation(array $data): Model
|
||||
{
|
||||
$service = app(PageService::class);
|
||||
$page = Page::query()->create([
|
||||
'path' => $service->normalizePath($data['path']),
|
||||
]);
|
||||
|
||||
$service->saveRevision(
|
||||
$page,
|
||||
$data['blocks'] ?? [],
|
||||
$data['seo_title'] ?? null,
|
||||
$data['seo_description'] ?? null,
|
||||
auth()->user(),
|
||||
);
|
||||
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Pages\Pages;
|
||||
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Filament\Resources\Pages\PageResource;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EditPage extends EditRecord
|
||||
{
|
||||
protected static string $resource = PageResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('preview')
|
||||
->label('Vorschau')
|
||||
->url(function (): string {
|
||||
$revision = $this->record->latestRevision;
|
||||
|
||||
return $revision === null
|
||||
? '#'
|
||||
: route('pages.preview', $revision);
|
||||
})
|
||||
->openUrlInNewTab(),
|
||||
Action::make('publish')
|
||||
->label('Veröffentlichen')
|
||||
->requiresConfirmation()
|
||||
->visible(fn (): bool => auth()->user()?->can('publish', $this->record) ?? false)
|
||||
->action(function (PageService $service): void {
|
||||
$revision = $this->record->latestRevision;
|
||||
abort_if($revision === null, 404);
|
||||
$service->publish($this->record, $revision);
|
||||
$this->record->refresh();
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
$revision = $this->record->latestRevision ?? $this->record->publishedRevision;
|
||||
$data['blocks'] = $revision?->blocks ?? [];
|
||||
$data['seo_title'] = $revision?->seo_title;
|
||||
$data['seo_description'] = $revision?->seo_description;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function handleRecordUpdate(Model $record, array $data): Model
|
||||
{
|
||||
/** @var Page $record */
|
||||
$service = app(PageService::class);
|
||||
$record->update([
|
||||
'path' => $service->normalizePath($data['path']),
|
||||
]);
|
||||
|
||||
$service->saveRevision(
|
||||
$record,
|
||||
$data['blocks'] ?? [],
|
||||
$data['seo_title'] ?? null,
|
||||
$data['seo_description'] ?? null,
|
||||
auth()->user(),
|
||||
);
|
||||
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Pages\Pages;
|
||||
|
||||
use App\Filament\Resources\Pages\PageResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPages extends ListRecords
|
||||
{
|
||||
protected static string $resource = PageResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Pages\RelationManagers;
|
||||
|
||||
use App\Domain\Cms\PageRevision;
|
||||
use App\Domain\Cms\PageService;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class RevisionsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'revisions';
|
||||
|
||||
protected static ?string $title = 'Revisionen';
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('id')->label('Nr.'),
|
||||
TextColumn::make('created_at')->label('Gespeichert')->dateTime('d.m.Y H:i'),
|
||||
TextColumn::make('author.name')->label('Von'),
|
||||
TextColumn::make('published')
|
||||
->label('Live')
|
||||
->state(fn (PageRevision $record): string => $record->id === $this->getOwnerRecord()->published_revision_id ? 'Ja' : 'Nein'),
|
||||
])
|
||||
->recordActions([
|
||||
Action::make('publish')
|
||||
->label('Veröffentlichen')
|
||||
->requiresConfirmation()
|
||||
->visible(fn (): bool => auth()->user()?->can('publish', $this->getOwnerRecord()) ?? false)
|
||||
->action(function (PageRevision $record, PageService $service): void {
|
||||
$service->publish($this->getOwnerRecord(), $record);
|
||||
$this->getOwnerRecord()->refresh();
|
||||
}),
|
||||
Action::make('restore')
|
||||
->label('Wiederherstellen')
|
||||
->requiresConfirmation()
|
||||
->modalDescription('Es entsteht eine neue Revision. Die Live-Seite bleibt unverändert, bis sie veröffentlicht wird.')
|
||||
->action(function (PageRevision $record, PageService $service): void {
|
||||
$service->restore($this->getOwnerRecord(), $record, auth()->user());
|
||||
}),
|
||||
])
|
||||
->defaultSort('id', 'desc');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Users\Pages;
|
||||
|
||||
use App\Filament\Resources\Users\UserResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CreateUser extends CreateRecord
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function handleRecordCreation(array $data): Model
|
||||
{
|
||||
return UserResource::persist(new ($this->getModel()), $data, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Users\Pages;
|
||||
|
||||
use App\Filament\Resources\Users\UserResource;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EditUser extends EditRecord
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
$data['roles'] = $this->record->staffRoles->map(fn ($assignment) => $assignment->role->value)->all();
|
||||
$data['status'] = $this->record->status->value;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function handleRecordUpdate(Model $record, array $data): Model
|
||||
{
|
||||
return UserResource::persist($record, $data, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Users\Pages;
|
||||
|
||||
use App\Filament\Resources\Users\UserResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListUsers extends ListRecords
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Users;
|
||||
|
||||
use App\Domain\Identity\AccountStatus;
|
||||
use App\Domain\Identity\AssignStaffRoles;
|
||||
use App\Domain\Identity\RegisterAccount;
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Filament\Resources\Users\Pages\CreateUser;
|
||||
use App\Filament\Resources\Users\Pages\EditUser;
|
||||
use App\Filament\Resources\Users\Pages\ListUsers;
|
||||
use App\Models\User;
|
||||
use Filament\Forms\Components\CheckboxList;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class UserResource extends Resource
|
||||
{
|
||||
protected static ?string $model = User::class;
|
||||
|
||||
protected static ?string $navigationLabel = 'Benutzer';
|
||||
|
||||
protected static ?string $modelLabel = 'Benutzer';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Benutzer';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'email';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
TextInput::make('name')->label('Name')->required()->maxLength(120),
|
||||
TextInput::make('email')->label('E-Mail')->email()->required()->maxLength(255),
|
||||
TextInput::make('password')
|
||||
->label('Passwort')
|
||||
->password()
|
||||
->revealable()
|
||||
->required(fn (string $operation): bool => $operation === 'create')
|
||||
->dehydrated(fn (?string $state): bool => filled($state))
|
||||
->minLength(8),
|
||||
Select::make('status')
|
||||
->label('Status')
|
||||
->options(collect(AccountStatus::cases())->mapWithKeys(
|
||||
fn (AccountStatus $status): array => [$status->value => $status->label()],
|
||||
)->all())
|
||||
->required()
|
||||
->default(AccountStatus::Aktiv->value),
|
||||
CheckboxList::make('roles')
|
||||
->label('Personalrollen')
|
||||
->options(StaffRole::options())
|
||||
->columns(2),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')->label('Name')->searchable(),
|
||||
TextColumn::make('email')->label('E-Mail')->searchable(),
|
||||
TextColumn::make('status')->label('Status')->formatStateUsing(
|
||||
fn (AccountStatus|string|null $state): string => $state instanceof AccountStatus ? $state->label() : (string) $state,
|
||||
),
|
||||
TextColumn::make('staffRoles.role')
|
||||
->label('Rollen')
|
||||
->badge()
|
||||
->formatStateUsing(fn (StaffRole|string $state): string => $state instanceof StaffRole ? $state->label() : StaffRole::from($state)->label()),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListUsers::route('/'),
|
||||
'create' => CreateUser::route('/create'),
|
||||
'edit' => EditUser::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
public static function persist(User $user, array $data, bool $creating): User
|
||||
{
|
||||
$roles = $data['roles'] ?? [];
|
||||
unset($data['roles']);
|
||||
|
||||
if ($creating) {
|
||||
$user = app(RegisterAccount::class)->register(
|
||||
$data['name'],
|
||||
$data['email'],
|
||||
$data['password'],
|
||||
true,
|
||||
);
|
||||
$user->forceFill([
|
||||
'status' => $data['status'],
|
||||
'email_verified_at' => now(),
|
||||
])->save();
|
||||
} else {
|
||||
if (blank($data['password'] ?? null)) {
|
||||
unset($data['password']);
|
||||
}
|
||||
|
||||
$user->update($data);
|
||||
}
|
||||
|
||||
app(AssignStaffRoles::class)->sync($user, $roles, auth()->user());
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class EmailVerificationController extends Controller
|
||||
{
|
||||
public function notice(Request $request): View|RedirectResponse
|
||||
{
|
||||
if ($request->user()->hasVerifiedEmail()) {
|
||||
return redirect()->route('member.dashboard');
|
||||
}
|
||||
|
||||
return view('auth.verify-email');
|
||||
}
|
||||
|
||||
public function verify(EmailVerificationRequest $request): RedirectResponse
|
||||
{
|
||||
$request->fulfill();
|
||||
|
||||
return redirect()->route('member.dashboard');
|
||||
}
|
||||
|
||||
public function send(Request $request): RedirectResponse
|
||||
{
|
||||
if ($request->user()->hasVerifiedEmail()) {
|
||||
return redirect()->route('member.dashboard');
|
||||
}
|
||||
|
||||
$request->user()->sendEmailVerificationNotification();
|
||||
|
||||
return back()->with('status', 'Die Nachricht ist erneut unterwegs.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Auth\Events\PasswordReset;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rules\Password as PasswordRule;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class PasswordResetController extends Controller
|
||||
{
|
||||
public function requestForm(): View
|
||||
{
|
||||
return view('auth.forgot-password');
|
||||
}
|
||||
|
||||
public function send(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validate(['email' => ['required', 'email']]);
|
||||
|
||||
$status = Password::sendResetLink($request->only('email'));
|
||||
|
||||
return $status === Password::RESET_LINK_SENT
|
||||
? back()->with('status', 'Wenn ein Konto zu dieser Adresse besteht, ist die Nachricht unterwegs.')
|
||||
: back()->withErrors(['email' => 'Die Nachricht konnte nicht gesendet werden.']);
|
||||
}
|
||||
|
||||
public function resetForm(string $token): View
|
||||
{
|
||||
return view('auth.reset-password', ['token' => $token, 'email' => request('email')]);
|
||||
}
|
||||
|
||||
public function reset(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'token' => ['required'],
|
||||
'email' => ['required', 'email'],
|
||||
'password' => ['required', 'confirmed', PasswordRule::defaults()],
|
||||
]);
|
||||
|
||||
$status = Password::reset(
|
||||
$request->only('email', 'password', 'password_confirmation', 'token'),
|
||||
function ($user, string $password): void {
|
||||
$user->forceFill([
|
||||
'password' => $password,
|
||||
'remember_token' => Str::random(60),
|
||||
])->save();
|
||||
|
||||
event(new PasswordReset($user));
|
||||
},
|
||||
);
|
||||
|
||||
return $status === Password::PASSWORD_RESET
|
||||
? redirect()->route('login')->with('status', 'Das Passwort ist geändert. Sie können sich anmelden.')
|
||||
: back()->withErrors(['email' => 'Der Link ist ungültig oder abgelaufen.']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Domain\Identity\RegisterAccount;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class RegistrationController extends Controller
|
||||
{
|
||||
public function create(): View
|
||||
{
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
public function store(Request $request, RegisterAccount $register): RedirectResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'name' => ['required', 'string', 'max:120'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email'],
|
||||
'password' => ['required', 'confirmed', Password::defaults()],
|
||||
'adult' => ['accepted'],
|
||||
], [
|
||||
'adult.accepted' => 'Die Plattform richtet sich an Erwachsene. Bitte bestätigen Sie das.',
|
||||
]);
|
||||
|
||||
$user = $register->register($data['name'], $data['email'], $data['password'], true);
|
||||
|
||||
event(new Registered($user));
|
||||
|
||||
auth()->login($user);
|
||||
|
||||
return redirect()->route('verification.notice');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Domain\Identity\AccountStatus;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class SessionController extends Controller
|
||||
{
|
||||
public function create(): View
|
||||
{
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$credentials = $request->validate([
|
||||
'email' => ['required', 'email'],
|
||||
'password' => ['required', 'string'],
|
||||
]);
|
||||
|
||||
$user = User::query()->where('email', $credentials['email'])->first();
|
||||
|
||||
if ($user !== null && $user->status !== AccountStatus::Aktiv) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => 'Dieses Konto ist nicht aktiv.',
|
||||
]);
|
||||
}
|
||||
|
||||
if (! Auth::attempt($credentials, $request->boolean('remember'))) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => 'E-Mail oder Passwort stimmt nicht.',
|
||||
]);
|
||||
}
|
||||
|
||||
$request->session()->regenerate();
|
||||
|
||||
return redirect()->intended(route('member.dashboard'));
|
||||
}
|
||||
|
||||
public function destroy(Request $request): RedirectResponse
|
||||
{
|
||||
Auth::guard('web')->logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
return redirect()->route('home');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
abstract class Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Member;
|
||||
|
||||
use App\Domain\Identity\AccountStatus;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class MemberController extends Controller
|
||||
{
|
||||
public function dashboard(): View
|
||||
{
|
||||
return view('member.dashboard');
|
||||
}
|
||||
|
||||
public function library(): View
|
||||
{
|
||||
return view('member.library');
|
||||
}
|
||||
|
||||
public function materials(): View
|
||||
{
|
||||
return view('member.materials');
|
||||
}
|
||||
|
||||
public function grants(): View
|
||||
{
|
||||
return view('member.grants');
|
||||
}
|
||||
|
||||
public function profile(): View
|
||||
{
|
||||
return view('member.profile');
|
||||
}
|
||||
|
||||
public function updateProfile(Request $request): RedirectResponse
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
abort_if($user->status !== AccountStatus::Aktiv, 403);
|
||||
|
||||
$data = $request->validate([
|
||||
'name' => ['required', 'string', 'max:120'],
|
||||
]);
|
||||
|
||||
$user->name = $data['name'];
|
||||
$user->save();
|
||||
|
||||
$user->party?->update(['display_name' => $data['name']]);
|
||||
$user->party?->profile?->update(['display_name' => $data['name']]);
|
||||
|
||||
return redirect()->route('member.profile')->with('status', 'Der Name ist gespeichert. Er ist nicht öffentlich.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageRevision;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class PageController extends Controller
|
||||
{
|
||||
public function home(): View
|
||||
{
|
||||
return $this->render(Page::query()->where('path', '/')->firstOrFail(), preview: false);
|
||||
}
|
||||
|
||||
public function show(string $path): View
|
||||
{
|
||||
return $this->render(Page::query()->where('path', '/'.$path)->firstOrFail(), preview: false);
|
||||
}
|
||||
|
||||
public function preview(PageRevision $revision): View
|
||||
{
|
||||
$page = $revision->page;
|
||||
Gate::authorize('view', $page);
|
||||
|
||||
return $this->render($page, preview: true, revision: $revision);
|
||||
}
|
||||
|
||||
public function sitemap(): Response
|
||||
{
|
||||
$pages = Page::query()->whereNotNull('published_revision_id')->orderBy('path')->get();
|
||||
|
||||
return response()
|
||||
->view('public.sitemap', ['pages' => $pages])
|
||||
->header('Content-Type', 'application/xml');
|
||||
}
|
||||
|
||||
private function render(Page $page, bool $preview, ?PageRevision $revision = null): View
|
||||
{
|
||||
$revision ??= $page->publishedRevision;
|
||||
abort_if($revision === null, 404);
|
||||
|
||||
$heading = collect($revision->blocks)->firstWhere('type', 'heading');
|
||||
|
||||
return view('public.page', [
|
||||
'page' => $page,
|
||||
'revision' => $revision,
|
||||
'preview' => $preview,
|
||||
'documentTitle' => $revision->seo_title ?: ($heading['heading'] ?? config('app.name')),
|
||||
'documentDescription' => $revision->seo_description,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class PublicMediaController extends Controller
|
||||
{
|
||||
public function show(string $path): StreamedResponse
|
||||
{
|
||||
abort_if(str_contains($path, '..') || ! str_starts_with($path, 'cms/'), 404);
|
||||
|
||||
foreach (['media_public', 'cms_incoming'] as $disk) {
|
||||
if (Storage::disk($disk)->exists($path)) {
|
||||
return Storage::disk($disk)->response($path);
|
||||
}
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class UseStaffSessionCookie
|
||||
{
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
$referer = (string) $request->headers->get('referer', '');
|
||||
$staffRequest = $request->is('verwaltung', 'verwaltung/*')
|
||||
|| str_contains($referer, '/verwaltung');
|
||||
|
||||
if ($staffRequest) {
|
||||
config(['session.cookie' => 'luf_staff_session']);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class PublishPublicMedia implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(public string $path) {}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
if (str_contains($this->path, '..') || ! str_starts_with($this->path, 'cms/')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$incoming = Storage::disk('cms_incoming');
|
||||
|
||||
if (! $incoming->exists($this->path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Storage::disk('media_public')->put($this->path, $incoming->get($this->path));
|
||||
$incoming->delete($this->path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Domain\Identity\AccountStatus;
|
||||
use App\Domain\Identity\Party;
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Domain\Identity\StaffRoleAssignment;
|
||||
use Database\Factories\UserFactory;
|
||||
use Filament\Auth\MultiFactor\App\Concerns\InteractsWithAppAuthentication;
|
||||
use Filament\Auth\MultiFactor\App\Concerns\InteractsWithAppAuthenticationRecovery;
|
||||
use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthentication;
|
||||
use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthenticationRecovery;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Panel;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Attributes\Hidden;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
#[Fillable(['party_id', 'name', 'email', 'password', 'status', 'confirmed_adult_at'])]
|
||||
#[Hidden(['password', 'remember_token'])]
|
||||
class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, MustVerifyEmail
|
||||
{
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
use InteractsWithAppAuthentication;
|
||||
use InteractsWithAppAuthenticationRecovery;
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'confirmed_adult_at' => 'datetime',
|
||||
'status' => AccountStatus::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function party(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Party::class);
|
||||
}
|
||||
|
||||
public function staffRoles(): HasMany
|
||||
{
|
||||
return $this->hasMany(StaffRoleAssignment::class);
|
||||
}
|
||||
|
||||
public function hasStaffRole(StaffRole $role): bool
|
||||
{
|
||||
if ($this->relationLoaded('staffRoles')) {
|
||||
return $this->staffRoles->contains(fn (StaffRoleAssignment $assignment): bool => $assignment->role === $role);
|
||||
}
|
||||
|
||||
return $this->staffRoles()->where('role', $role->value)->exists();
|
||||
}
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return $this->status === AccountStatus::Aktiv
|
||||
&& $this->hasVerifiedEmail()
|
||||
&& $this->staffRoles()->exists();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Models\User;
|
||||
|
||||
class UserPolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->hasStaffRole(StaffRole::Systemverwalter);
|
||||
}
|
||||
|
||||
public function view(User $user, User $model): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function update(User $user, User $model): bool
|
||||
{
|
||||
return $this->viewAny($user);
|
||||
}
|
||||
|
||||
public function delete(User $user, User $model): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Domain\Cms\NavigationItem;
|
||||
use App\Domain\Cms\NavigationItemPolicy;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PagePolicy;
|
||||
use App\Models\User;
|
||||
use App\Policies\UserPolicy;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
Gate::policy(Page::class, PagePolicy::class);
|
||||
Gate::policy(NavigationItem::class, NavigationItemPolicy::class);
|
||||
Gate::policy(User::class, UserPolicy::class);
|
||||
|
||||
View::composer('layouts.site', function ($view): void {
|
||||
if (! array_key_exists('navigation', $view->getData())) {
|
||||
$view->with('navigation', NavigationItem::query()->with('page')->orderBy('sort_order')->orderBy('id')->get());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers\Filament;
|
||||
|
||||
use Filament\Auth\MultiFactor\App\AppAuthentication;
|
||||
use Filament\Http\Middleware\Authenticate;
|
||||
use Filament\Http\Middleware\AuthenticateSession;
|
||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||
use Filament\Pages\Dashboard;
|
||||
use Filament\Panel;
|
||||
use Filament\PanelProvider;
|
||||
use Filament\Support\Colors\Color;
|
||||
use Filament\Widgets\AccountWidget;
|
||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestForgery;
|
||||
use Illuminate\Routing\Middleware\SubstituteBindings;
|
||||
use Illuminate\Session\Middleware\StartSession;
|
||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||
|
||||
class AdminPanelProvider extends PanelProvider
|
||||
{
|
||||
public function panel(Panel $panel): Panel
|
||||
{
|
||||
return $panel
|
||||
->default()
|
||||
->id('verwaltung')
|
||||
->path('verwaltung')
|
||||
->login()
|
||||
->brandName('Verwaltung')
|
||||
->authGuard('staff')
|
||||
->colors([
|
||||
'primary' => Color::hex('#0F6E56'),
|
||||
])
|
||||
->multiFactorAuthentication([
|
||||
AppAuthentication::make()->recoverable(),
|
||||
], isRequired: true)
|
||||
->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources')
|
||||
->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages')
|
||||
->pages([
|
||||
Dashboard::class,
|
||||
])
|
||||
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\Filament\Widgets')
|
||||
->widgets([
|
||||
AccountWidget::class,
|
||||
])
|
||||
->middleware([
|
||||
EncryptCookies::class,
|
||||
AddQueuedCookiesToResponse::class,
|
||||
StartSession::class,
|
||||
AuthenticateSession::class,
|
||||
ShareErrorsFromSession::class,
|
||||
PreventRequestForgery::class,
|
||||
SubstituteBindings::class,
|
||||
DisableBladeIconComponents::class,
|
||||
DispatchServingFilamentEvent::class,
|
||||
])
|
||||
->authMiddleware([
|
||||
Authenticate::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the command...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
$status = $app->handleCommand(new ArgvInput);
|
||||
|
||||
exit($status);
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Middleware\UseStaffSessionCookie;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
web: __DIR__.'/../routes/web.php',
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
$middleware->trustProxies(at: '*');
|
||||
$middleware->prepend(UseStaffSessionCookie::class);
|
||||
$middleware->redirectGuestsTo(function (Request $request) {
|
||||
if ($request->is('verwaltung', 'verwaltung/*')) {
|
||||
return '/verwaltung/login';
|
||||
}
|
||||
|
||||
return '/anmelden';
|
||||
});
|
||||
$middleware->redirectUsersTo(function (Request $request) {
|
||||
if ($request->is('verwaltung', 'verwaltung/*')) {
|
||||
return '/verwaltung';
|
||||
}
|
||||
|
||||
return '/bereich';
|
||||
});
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
$exceptions->shouldRenderJsonWhen(
|
||||
fn (Request $request) => $request->is('api/*') || $request->expectsJson(),
|
||||
);
|
||||
})->create();
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use App\Providers\AppServiceProvider;
|
||||
use App\Providers\Filament\AdminPanelProvider;
|
||||
|
||||
return [
|
||||
AppServiceProvider::class,
|
||||
AdminPanelProvider::class,
|
||||
];
|
||||
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"$schema": "https://getcomposer.org/schema.json",
|
||||
"name": "lara-und-felix/app",
|
||||
"type": "project",
|
||||
"description": "Lara & Felix \u2013 Stark im Alltag",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"filament"
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.4",
|
||||
"filament/filament": "^5.0",
|
||||
"laravel/framework": "^13.17",
|
||||
"laravel/tinker": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.2.5",
|
||||
"laravel/pao": "^1.0.6",
|
||||
"laravel/pint": "^1.27",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"phpunit/phpunit": "^12.5.12"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"setup": [
|
||||
"composer install",
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||
"@php artisan key:generate",
|
||||
"@php artisan migrate --force",
|
||||
"npm install --ignore-scripts",
|
||||
"npm run build"
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"@php artisan dev"
|
||||
],
|
||||
"test": [
|
||||
"@php artisan config:clear --ansi @no_additional_args",
|
||||
"@php artisan test"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi",
|
||||
"@php artisan filament:upgrade"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi",
|
||||
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||
"@php artisan migrate --graceful --ansi"
|
||||
],
|
||||
"pre-package-uninstall": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true,
|
||||
"php-http/discovery": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
||||
Generated
+10907
File diff suppressed because it is too large.
Load diff
+126
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application, which will be used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| other UI elements where an application name needs to be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the "environment" your application is currently
|
||||
| running in. This may determine how you prefer to configure various
|
||||
| services the application utilizes. Set this in your ".env" file.
|
||||
|
|
||||
*/
|
||||
|
||||
'env' => env('APP_ENV', 'production'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| the application so that it's available within Artisan commands.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. The timezone
|
||||
| is set to "UTC" by default as it is suitable for most use cases.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by Laravel's translation / localization methods. This option can be
|
||||
| set to any locale for which you plan to have translation strings.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => env('APP_LOCALE', 'de'),
|
||||
|
||||
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||
|
||||
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is utilized by Laravel's encryption services and should be set
|
||||
| to a random, 32 character string to ensure that all encrypted values
|
||||
| are secure. You should do this prior to deploying the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'previous_keys' => [
|
||||
...array_filter(
|
||||
explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options determine the driver used to determine and
|
||||
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||
| allow maintenance mode to be controlled across multiple machines.
|
||||
|
|
||||
| Supported drivers: "file", "cache", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
|
||||
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||
],
|
||||
|
||||
];
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default authentication "guard" and password
|
||||
| reset "broker" for your application. You may change these values
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => env('AUTH_GUARD', 'web'),
|
||||
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| which utilizes session storage plus the Eloquent user provider.
|
||||
|
|
||||
| All authentication guards have a user provider, which defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| system used by the application. Typically, Eloquent is utilized.
|
||||
|
|
||||
| Supported: "session"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
|
||||
'staff' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication guards have a user provider, which defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| system used by the application. Typically, Eloquent is utilized.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| providers to represent the model / table. These providers may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => env('AUTH_MODEL', User::class),
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options specify the behavior of Laravel's password
|
||||
| reset functionality, including the table utilized for token storage
|
||||
| and the user provider that is invoked to actually retrieve users.
|
||||
|
|
||||
| The expiry time is the number of minutes that each reset token will be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
| The throttle setting is the number of seconds a user must wait before
|
||||
| generating more password reset tokens. This prevents the user from
|
||||
| quickly generating a very large amount of password reset tokens.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
|
||||
'expire' => 60,
|
||||
'throttle' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Confirmation Timeout
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define the number of seconds before a password confirmation
|
||||
| window expires and users are asked to re-enter their password via the
|
||||
| confirmation screen. By default, the timeout lasts for three hours.
|
||||
|
|
||||
*/
|
||||
|
||||
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
|
||||
|
||||
];
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache store that will be used by the
|
||||
| framework. This connection is utilized if another isn't explicitly
|
||||
| specified when running a cache operation inside the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_STORE', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "array", "database", "file", "memcached",
|
||||
| "redis", "dynamodb", "storage", "octane",
|
||||
| "session", "failover", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'connection' => env('DB_CACHE_CONNECTION'),
|
||||
'table' => env('DB_CACHE_TABLE', 'cache'),
|
||||
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
||||
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path('framework/cache/data'),
|
||||
'lock_path' => storage_path('framework/cache/locks'),
|
||||
],
|
||||
|
||||
'storage' => [
|
||||
'driver' => 'storage',
|
||||
'disk' => env('CACHE_STORAGE_DISK'),
|
||||
'path' => env('CACHE_STORAGE_PATH', 'framework/cache/data'),
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
'port' => env('MEMCACHED_PORT', 11211),
|
||||
'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
|
||||
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
|
||||
],
|
||||
|
||||
'dynamodb' => [
|
||||
'driver' => 'dynamodb',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||
],
|
||||
|
||||
'octane' => [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'driver' => 'failover',
|
||||
'stores' => [
|
||||
'database',
|
||||
'array',
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
|
||||
| stores, there might be other applications using the same cache. For
|
||||
| that reason, you may prefix every cache key to avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Serializable Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the classes that can be unserialized from cache
|
||||
| storage. By default, no PHP classes will be unserialized from your
|
||||
| cache to prevent gadget chain attacks if your APP_KEY is leaked.
|
||||
|
|
||||
*/
|
||||
|
||||
'serializable_classes' => false,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Pdo\Mysql;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for database operations. This is
|
||||
| the connection which will be utilized unless another connection
|
||||
| is explicitly specified when you execute a query / statement.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below are all of the database connections defined for your application.
|
||||
| An example configuration is provided for each database system which
|
||||
| is supported by Laravel. You're free to add / remove connections.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DB_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
'busy_timeout' => null,
|
||||
'journal_mode' => null,
|
||||
'synchronous' => null,
|
||||
'transaction_mode' => 'DEFERRED',
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'mariadb' => [
|
||||
'driver' => 'mariadb',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => env('DB_SSLMODE', 'prefer'),
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DB_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'laravel'),
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => env('DB_CHARSET', 'utf8'),
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run on the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => [
|
||||
'table' => 'migrations',
|
||||
'update_date_on_publish' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as Memcached. You may define your connection settings here.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'),
|
||||
'persistent' => env('REDIS_PERSISTENT', false),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
'max_retries' => env('REDIS_MAX_RETRIES', 3),
|
||||
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
|
||||
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
|
||||
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
'max_retries' => env('REDIS_MAX_RETRIES', 3),
|
||||
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
|
||||
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
|
||||
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application for file storage.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DISK', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below you may configure as many filesystem disks as necessary, and you
|
||||
| may even configure multiple disks for the same driver. Examples for
|
||||
| most supported storage drivers are configured here for reference.
|
||||
|
|
||||
| Supported drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/private'),
|
||||
'serve' => true,
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage',
|
||||
'visibility' => 'public',
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'cms_incoming' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/private/cms-incoming'),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'media_public' => [
|
||||
'driver' => 'local',
|
||||
'root' => env('MEDIA_PUBLIC_PATH') ?: storage_path('app/media-public'),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'media_derived' => [
|
||||
'driver' => 'local',
|
||||
'root' => env('MEDIA_DERIVED_PATH') ?: storage_path('app/media-derived'),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
'media_originals' => [
|
||||
'driver' => 'local',
|
||||
'root' => env('MEDIA_ORIGINALS_PATH') ?: storage_path('app/media-originals'),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION'),
|
||||
'bucket' => env('AWS_BUCKET'),
|
||||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Symbolic Links
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the symbolic links that will be created when the
|
||||
| `storage:link` Artisan command is executed. The array keys should be
|
||||
| the locations of the links and the values should be their targets.
|
||||
|
|
||||
*/
|
||||
|
||||
'links' => [
|
||||
public_path('storage') => storage_path('app/public'),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\SyslogUdpHandler;
|
||||
use Monolog\Processor\PsrLogMessageProcessor;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that is utilized to write
|
||||
| messages to your logs. The value provided here should match one of
|
||||
| the channels present in the list of "channels" configured below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Deprecations Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the log channel that should be used to log warnings
|
||||
| regarding deprecated PHP and library features. This allows you to get
|
||||
| your application ready for upcoming major versions of dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'deprecations' => [
|
||||
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Laravel
|
||||
| utilizes the Monolog PHP logging library, which includes a variety
|
||||
| of powerful log handlers and formatters that you're free to use.
|
||||
|
|
||||
| Available drivers: "single", "daily", "monthly", "slack", "syslog",
|
||||
| "errorlog", "monolog", "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'max_files' => env('LOG_DAILY_DAYS', 14),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'monthly' => [
|
||||
'driver' => 'monthly',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'max_files' => 3,
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => env('LOG_SLACK_USERNAME', env('APP_NAME', 'Laravel')),
|
||||
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
|
||||
'level' => env('LOG_LEVEL', 'critical'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'papertrail' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
||||
],
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'handler_with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => NullHandler::class,
|
||||
],
|
||||
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Mailer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default mailer that is used to send all email
|
||||
| messages unless another mailer is explicitly specified when sending
|
||||
| the message. All additional mailers can be configured within the
|
||||
| "mailers" array. Examples of each type of mailer are provided.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('MAIL_MAILER', 'log'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailer Configurations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure all of the mailers used by your application plus
|
||||
| their respective settings. Several examples have been configured for
|
||||
| you and you are free to add your own as your application requires.
|
||||
|
|
||||
| Laravel supports a variety of mail "transport" drivers that can be used
|
||||
| when delivering an email. You may specify which one you're using for
|
||||
| your mailers below. You may also add additional mailers if needed.
|
||||
|
|
||||
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||
| "postmark", "resend", "log", "array",
|
||||
| "failover", "roundrobin"
|
||||
|
|
||||
*/
|
||||
|
||||
'mailers' => [
|
||||
|
||||
'smtp' => [
|
||||
'transport' => 'smtp',
|
||||
'scheme' => env('MAIL_SCHEME'),
|
||||
'url' => env('MAIL_URL'),
|
||||
'host' => env('MAIL_HOST', '127.0.0.1'),
|
||||
'port' => env('MAIL_PORT', 2525),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'timeout' => null,
|
||||
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'transport' => 'ses',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'transport' => 'postmark',
|
||||
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
|
||||
// 'client' => [
|
||||
// 'timeout' => 5,
|
||||
// ],
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'transport' => 'resend',
|
||||
],
|
||||
|
||||
'sendmail' => [
|
||||
'transport' => 'sendmail',
|
||||
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'transport' => 'log',
|
||||
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'transport' => 'array',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'transport' => 'failover',
|
||||
'mailers' => [
|
||||
'smtp',
|
||||
'log',
|
||||
],
|
||||
'retry_after' => 60,
|
||||
],
|
||||
|
||||
'roundrobin' => [
|
||||
'transport' => 'roundrobin',
|
||||
'mailers' => [
|
||||
'ses',
|
||||
'postmark',
|
||||
],
|
||||
'retry_after' => 60,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all emails sent by your application to be sent from
|
||||
| the same address. Here you may specify a name and address that is
|
||||
| used globally for all emails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => [
|
||||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||
'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Laravel')),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Queue Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel's queue supports a variety of backends via a single, unified
|
||||
| API, giving you convenient access to each backend using identical
|
||||
| syntax for each. The default queue connection is defined below.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('QUEUE_CONNECTION', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queue Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the connection options for every queue backend
|
||||
| used by your application. An example configuration is provided for
|
||||
| each backend supported by Laravel. You're also free to add more.
|
||||
|
|
||||
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
|
||||
| "deferred", "background", "failover", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sync' => [
|
||||
'driver' => 'sync',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'connection' => env('DB_QUEUE_CONNECTION'),
|
||||
'table' => env('DB_QUEUE_TABLE', 'jobs'),
|
||||
'queue' => env('DB_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'beanstalkd' => [
|
||||
'driver' => 'beanstalkd',
|
||||
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
|
||||
'queue' => env('BEANSTALKD_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
|
||||
'block_for' => 0,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'sqs' => [
|
||||
'driver' => 'sqs',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||
'queue' => env('SQS_QUEUE', 'default'),
|
||||
'suffix' => env('SQS_SUFFIX'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
||||
'queue' => env('REDIS_QUEUE', 'default'),
|
||||
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
|
||||
'block_for' => null,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'deferred' => [
|
||||
'driver' => 'deferred',
|
||||
],
|
||||
|
||||
'background' => [
|
||||
'driver' => 'background',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'driver' => 'failover',
|
||||
'connections' => [
|
||||
'database',
|
||||
'deferred',
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Job Batching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following options configure the database and table that store job
|
||||
| batching information. These options can be updated to any database
|
||||
| connection and table which has been defined by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'batching' => [
|
||||
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||
'table' => 'job_batches',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Failed Queue Jobs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These options configure the behavior of failed queue job logging so you
|
||||
| can control how and where failed jobs are stored. Laravel ships with
|
||||
| support for storing failed jobs in a simple file or in a database.
|
||||
|
|
||||
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => [
|
||||
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||
'table' => 'failed_jobs',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Third Party Services
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is for storing the credentials for third party services such
|
||||
| as Resend, Postmark, AWS, and more. This file provides the de facto
|
||||
| location for this type of information, allowing packages to have
|
||||
| a conventional file to locate the various service credentials.
|
||||
|
|
||||
*/
|
||||
|
||||
'postmark' => [
|
||||
'key' => env('POSTMARK_API_KEY'),
|
||||
],
|
||||
|
||||
'resend' => [
|
||||
'key' => env('RESEND_API_KEY'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'notifications' => [
|
||||
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
|
||||
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines the default session driver that is utilized for
|
||||
| incoming requests. Laravel supports a variety of storage options to
|
||||
| persist session data. Database storage is a great default choice.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "memcached",
|
||||
| "redis", "dynamodb", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SESSION_DRIVER', 'database'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to expire immediately when the browser is closed then you may
|
||||
| indicate that via the expire_on_close configuration option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => (int) env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Encryption
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to easily specify that all of your session data
|
||||
| should be encrypted before it's stored. All encryption is performed
|
||||
| automatically by Laravel and you may use the session like normal.
|
||||
|
|
||||
*/
|
||||
|
||||
'encrypt' => env('SESSION_ENCRYPT', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the "file" session driver, the session files are placed
|
||||
| on disk. The default storage location is defined here; however, you
|
||||
| are free to provide another location where they should be stored.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path('framework/sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => env('SESSION_CONNECTION'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table to
|
||||
| be used to store sessions. Of course, a sensible default is defined
|
||||
| for you; however, you're welcome to change this to another table.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => env('SESSION_TABLE', 'sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using one of the framework's cache driven session backends, you may
|
||||
| define the cache store which should be used to store the session data
|
||||
| between requests. This must match one of your defined cache stores.
|
||||
|
|
||||
| Affects: "dynamodb", "memcached", "redis"
|
||||
|
|
||||
*/
|
||||
|
||||
'store' => env('SESSION_STORE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => [2, 100],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the session cookie that is created by
|
||||
| the framework. Typically, you should not need to change this value
|
||||
| since doing so does not grant a meaningful security improvement.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => env(
|
||||
'SESSION_COOKIE',
|
||||
Str::slug((string) env('APP_NAME', 'laravel')).'-session'
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application, but you're free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => env('SESSION_PATH', '/'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the domain and subdomains the session cookie is
|
||||
| available to. By default, the cookie will be available to the root
|
||||
| domain without subdomains. Typically, this shouldn't be changed.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('SESSION_DOMAIN'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you when it can't be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTP Access Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will prevent JavaScript from accessing the
|
||||
| value of the cookie and the cookie will only be accessible through
|
||||
| the HTTP protocol. It's unlikely you should disable this option.
|
||||
|
|
||||
*/
|
||||
|
||||
'http_only' => env('SESSION_HTTP_ONLY', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Same-Site Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines how your cookies behave when cross-site requests
|
||||
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||
| will set this value to "lax" to permit secure cross-site requests.
|
||||
|
|
||||
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
||||
|
|
||||
| Supported: "lax", "strict", "none", null
|
||||
|
|
||||
*/
|
||||
|
||||
'same_site' => env('SESSION_SAME_SITE', 'lax'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Partitioned Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will tie the cookie to the top-level site for
|
||||
| a cross-site context. Partitioned cookies are accepted by the browser
|
||||
| when flagged "secure" and the Same-Site attribute is set to "none".
|
||||
|
|
||||
*/
|
||||
|
||||
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Serialization
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value controls the serialization strategy for session data, which
|
||||
| is JSON by default. Setting this to "php" allows the storage of PHP
|
||||
| objects in the session but can make an application vulnerable to
|
||||
| "gadget chain" serialization attacks if the APP_KEY is leaked.
|
||||
|
|
||||
| Supported: "json", "php"
|
||||
|
|
||||
*/
|
||||
|
||||
'serialization' => 'json',
|
||||
|
||||
];
|
||||
@@ -0,0 +1 @@
|
||||
*.sqlite*
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Domain\Identity\AccountStatus;
|
||||
use App\Domain\Identity\Party;
|
||||
use App\Domain\Identity\PartyType;
|
||||
use App\Domain\Identity\Profile;
|
||||
use App\Domain\Identity\StaffRole;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
protected static ?string $password;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'status' => AccountStatus::Aktiv,
|
||||
'confirmed_adult_at' => now(),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
public function configure(): static
|
||||
{
|
||||
return $this->afterMaking(function (User $user): void {
|
||||
if ($user->party_id !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$party = Party::query()->create([
|
||||
'type' => PartyType::Person,
|
||||
'display_name' => $user->name,
|
||||
]);
|
||||
|
||||
$user->party_id = $party->id;
|
||||
})->afterCreating(function (User $user): void {
|
||||
Profile::query()->firstOrCreate(
|
||||
['party_id' => $user->party_id],
|
||||
[
|
||||
'display_name' => $user->name,
|
||||
'visibility' => ['display_name' => 'private'],
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
public function redakteur(): static
|
||||
{
|
||||
return $this->afterCreating(function (User $user): void {
|
||||
$user->staffRoles()->create(['role' => StaffRole::Redakteur]);
|
||||
});
|
||||
}
|
||||
|
||||
public function systemverwalter(): static
|
||||
{
|
||||
return $this->afterCreating(function (User $user): void {
|
||||
$user->staffRoles()->create(['role' => StaffRole::Systemverwalter]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('parties', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('type');
|
||||
$table->string('display_name');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('party_id')->nullable()->constrained('parties')->nullOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->string('status')->default('aktiv');
|
||||
$table->timestamp('confirmed_adult_at')->nullable();
|
||||
$table->text('app_authentication_secret')->nullable();
|
||||
$table->text('app_authentication_recovery_codes')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('profiles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('party_id')->unique()->constrained('parties')->cascadeOnDelete();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->json('visibility');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('staff_role_assignments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('role');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['user_id', 'role']);
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sessions');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('staff_role_assignments');
|
||||
Schema::dropIfExists('profiles');
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('parties');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->bigInteger('expiration')->index();
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->bigInteger('expiration')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedSmallInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->string('connection');
|
||||
$table->string('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
|
||||
$table->index(['connection', 'queue', 'failed_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Database\Seeders\CmsSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('pages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('path')->unique();
|
||||
$table->unsignedBigInteger('published_revision_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('page_revisions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('page_id')->constrained()->cascadeOnDelete();
|
||||
$table->json('blocks');
|
||||
$table->string('seo_title')->nullable();
|
||||
$table->string('seo_description', 500)->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
});
|
||||
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->foreign('published_revision_id')
|
||||
->references('id')
|
||||
->on('page_revisions')
|
||||
->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::create('navigation_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('label');
|
||||
$table->foreignId('page_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->string('url')->nullable();
|
||||
$table->string('placement')->default('header');
|
||||
$table->unsignedInteger('sort_order')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
(new CmsSeeder)->run();
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('navigation_items');
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->dropForeign(['published_revision_id']);
|
||||
});
|
||||
Schema::dropIfExists('page_revisions');
|
||||
Schema::dropIfExists('pages');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Domain\Cms\NavigationItem;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PageService;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CmsSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
if (Page::query()->exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$service = app(PageService::class);
|
||||
$pages = [];
|
||||
|
||||
foreach ($this->pages() as $path => $page) {
|
||||
$record = Page::query()->create(['path' => $path]);
|
||||
$revision = $service->saveRevision($record, $page['blocks'], $page['seo_title'], $page['seo_description'], null);
|
||||
$service->publish($record, $revision);
|
||||
$pages[$path] = $record;
|
||||
}
|
||||
|
||||
$order = 0;
|
||||
|
||||
foreach ($this->navigation() as $item) {
|
||||
NavigationItem::query()->create([
|
||||
'label' => $item['label'],
|
||||
'page_id' => isset($item['path']) ? $pages[$item['path']]->id : null,
|
||||
'url' => $item['url'] ?? null,
|
||||
'placement' => $item['placement'],
|
||||
'sort_order' => $order++,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array{seo_title: string, seo_description: string, blocks: list<array<string, mixed>>}>
|
||||
*/
|
||||
private function pages(): array
|
||||
{
|
||||
return [
|
||||
'/' => [
|
||||
'seo_title' => 'Lara & Felix – Stark im Alltag',
|
||||
'seo_description' => 'Plattform für Gewaltprävention, Selbstbehauptung und gewaltpräventive Bildungsarbeit.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Stark im Alltag',
|
||||
'intro' => 'Lara & Felix ist eine Plattform für Gewaltprävention, Selbstbehauptung und gewaltpräventive Bildungsarbeit. Sie unterstützt Erwachsene, die solche Angebote vorbereiten und durchführen.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => "Die Lerninhalte richten sich unter anderem an Kinder. Kinder sind keine Benutzerinnen und Benutzer der Plattform und brauchen kein eigenes Konto.\n\nDie Filme „Lara & Felix“ sind die erste Produktreihe. Übungen, Programme und weitere Materialien lassen sich in derselben Struktur verwalten, ohne die Plattform auf eine einzelne Episode festzulegen.",
|
||||
],
|
||||
[
|
||||
'type' => 'cards',
|
||||
'items' => [
|
||||
['title' => 'Prävention', 'text' => 'Worum es in der Bildungsarbeit geht.', 'url' => '/praevention'],
|
||||
['title' => 'Materialien', 'text' => 'Filme und Begleitmaterial, sobald sie veröffentlicht sind.', 'url' => '/materialien'],
|
||||
['title' => 'Für Trainer und Einrichtungen', 'text' => 'Wer die Plattform nutzt.', 'url' => '/trainer'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'call_to_action',
|
||||
'heading' => 'Mitgliederbereich',
|
||||
'text' => 'Nach der Anmeldung sehen Sie die Materialien, für die eine Berechtigung vorliegt.',
|
||||
'label' => 'Anmelden',
|
||||
'url' => '/anmelden',
|
||||
],
|
||||
],
|
||||
],
|
||||
'/praevention' => [
|
||||
'seo_title' => 'Präventionskonzept',
|
||||
'seo_description' => 'Gewaltprävention und Selbstbehauptung in der Bildungsarbeit mit Kindern.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Prävention im Alltag',
|
||||
'intro' => 'Die Plattform stellt Materialien bereit, mit denen Trainerinnen, Trainer und pädagogische Fachkräfte Präventionsangebote durchführen.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => "Es geht um Selbstbehauptung, das Erkennen von Grenzverletzungen und um Handlungsfähigkeit in konkreten Situationen. Die Durchführung bleibt bei den Erwachsenen vor Ort.\n\nEine Entscheidungspause in einem Film ist eine Markierung für den Präsenzkurs. Daraus wird kein digitales Quiz und keine eigenständige Lernanwendung für Kinder.",
|
||||
],
|
||||
],
|
||||
],
|
||||
'/materialien' => [
|
||||
'seo_title' => 'Filme und Lernmaterialien',
|
||||
'seo_description' => 'Veröffentlichte Filme, Übungen und Begleitmaterialien.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Filme und Lernmaterialien',
|
||||
'intro' => 'Hier erscheinen veröffentlichte Inhalte aus dem Katalog. Die Seite kopiert keine Produkttexte und nennt keine Preise.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => 'Solange noch kein Lizenzartikel veröffentlicht ist, bleibt diese Übersicht leer. Dieselbe Stelle zeigt später Filme, Übungen und Begleitmaterial aus den maßgeblichen Datensätzen.',
|
||||
],
|
||||
],
|
||||
],
|
||||
'/angebote' => [
|
||||
'seo_title' => 'Angebote',
|
||||
'seo_description' => 'Lizenzangebote werden aus dem Katalog gelesen, nicht als freier Text gepflegt.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Angebote',
|
||||
'intro' => 'Umfang, Rechte und Preise eines Angebots kommen aus dem Katalog. Sie werden hier nicht als freier Text ersetzt.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => 'Es sind noch keine Angebote veröffentlicht. Sobald ein Angebot aktiv ist, zeigt diese Seite seinen Umfang aus dem gespeicherten Stand.',
|
||||
],
|
||||
],
|
||||
],
|
||||
'/trainer' => [
|
||||
'seo_title' => 'Für Trainer und Einrichtungen',
|
||||
'seo_description' => 'Informationen für Gewaltschutztrainer, Übungsleiter, Fachkräfte, Vereine und Bildungseinrichtungen.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Für Trainer und Einrichtungen',
|
||||
'intro' => 'Die Plattform ist für Erwachsene, die geeignete Präventionsangebote durchführen.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => "Dazu gehören Gewaltschutztrainer, Trainer und Übungsleiter, pädagogische Fachkräfte sowie Vereine und Bildungseinrichtungen.\n\nEin Konto allein öffnet keine Materialien. Sichtbar wird, was eine konkrete Berechtigung erlaubt. Organisationen können später eigene Lizenzen halten. Eine persönliche Freischaltung ist keine Organisationslizenz.",
|
||||
],
|
||||
],
|
||||
],
|
||||
'/ueber' => [
|
||||
'seo_title' => 'Über das Projekt',
|
||||
'seo_description' => 'Lara & Felix – Stark im Alltag.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Über das Projekt',
|
||||
'intro' => 'Lara & Felix – Stark im Alltag ist eine eigenständige Plattform für Gewaltprävention, Selbstbehauptung und gewaltpräventive Bildungsarbeit.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => 'Die erste Produktreihe sind die vorhandenen Filme. Das Fachmodell bleibt offen für weitere Medienarten, Übungen und Programme.',
|
||||
],
|
||||
],
|
||||
],
|
||||
'/impressum' => [
|
||||
'seo_title' => 'Impressum',
|
||||
'seo_description' => 'Impressum der Plattform Lara & Felix.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Impressum',
|
||||
'intro' => 'Die gesetzlich erforderlichen Angaben werden hier veröffentlicht, sobald sie feststehen.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => 'Diese Seite ist redaktionell pflegbar. Sie enthält noch keine Angaben zu einer verantwortlichen Stelle.',
|
||||
],
|
||||
],
|
||||
],
|
||||
'/datenschutz' => [
|
||||
'seo_title' => 'Datenschutz',
|
||||
'seo_description' => 'Datenschutzhinweise der Plattform Lara & Felix.',
|
||||
'blocks' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'heading' => 'Datenschutz',
|
||||
'intro' => 'Die Datenschutzerklärung wird hier gepflegt und ist noch nicht eingesetzt.',
|
||||
],
|
||||
[
|
||||
'type' => 'prose',
|
||||
'body' => 'Profilangaben sind standardmäßig nicht öffentlich. Geschützte Medien werden nicht über einen öffentlichen Dateipfad ausgeliefert.',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, path?: string, url?: string, placement: string}>
|
||||
*/
|
||||
private function navigation(): array
|
||||
{
|
||||
return [
|
||||
['label' => 'Start', 'path' => '/', 'placement' => 'header'],
|
||||
['label' => 'Prävention', 'path' => '/praevention', 'placement' => 'header'],
|
||||
['label' => 'Materialien', 'path' => '/materialien', 'placement' => 'header'],
|
||||
['label' => 'Angebote', 'path' => '/angebote', 'placement' => 'header'],
|
||||
['label' => 'Trainer und Einrichtungen', 'path' => '/trainer', 'placement' => 'header'],
|
||||
['label' => 'Über das Projekt', 'path' => '/ueber', 'placement' => 'header'],
|
||||
['label' => 'Anmelden', 'url' => '/anmelden', 'placement' => 'header'],
|
||||
['label' => 'Impressum', 'path' => '/impressum', 'placement' => 'footer'],
|
||||
['label' => 'Datenschutz', 'path' => '/datenschutz', 'placement' => 'footer'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$this->call(CmsSeeder::class);
|
||||
}
|
||||
}
|
||||
@@ -19,3 +19,11 @@ SESSION_DRIVER=database
|
||||
CACHE_STORE=database
|
||||
QUEUE_CONNECTION=database
|
||||
LOG_CHANNEL=stderr
|
||||
|
||||
MAIL_MAILER=log
|
||||
MAIL_FROM_ADDRESS="noreply@example.invalid"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
MEDIA_PUBLIC_PATH=/media/public
|
||||
MEDIA_DERIVED_PATH=/media/derived
|
||||
MEDIA_ORIGINALS_PATH=/media/originals
|
||||
@@ -14,6 +14,10 @@ server {
|
||||
fastcgi_pass app:9000;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
|
||||
fastcgi_param HTTP_X_FORWARDED_HOST $http_x_forwarded_host;
|
||||
fastcgi_param HTTP_X_FORWARDED_PORT $http_x_forwarded_port;
|
||||
fastcgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
|
||||
fastcgi_read_timeout 120s;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ ## 0. Was die Challenger-Prüfung ergeben hat
|
||||
| Was hielt | die Gesamtarchitektur „Kern plus Community-Satellit“, das Vier-Ebenen-Modell, die Paketauflösung, die eingefrorene Bestellkopie, die unveränderlichen Fassungen, das Verbot der Rechtekombination, der Verzicht auf DRM |
|
||||
| Was nicht hielt | die Berechtigungsquelle (ein kostenloses Angebot hätte nur ein Mitglied bedient); die Berechtigungsentscheidung (Zugriff auf Medien nicht erworbener Artikel war nicht ausgeschlossen); die Upgrade-Mechanik (verschlechterte erworbene Rechte); mehrere Abläufe bei Gleichzeitigkeit und falscher Meldungsreihenfolge; die Sicherungs- und Wiederanlaufziele; die fehlende Schadensbegrenzung nach Überwindung einer Komponente; die Abgrenzung von Organisationslizenzen im ersten Schnitt |
|
||||
| Was sich durch neue Beschlüsse geändert hat | Die Updatepolitik ist entschieden (alle später freigegebenen Fassungen desselben Artikels); das konfigurierbare Versionsanspruchsmodell ist entfallen |
|
||||
| Technologie | Die Empfehlung „Django + Wagtail, knapp“ ist nicht bestätigt. Die Stapelwahl ist offen; ein abgegrenzter Machbarkeitsnachweis entscheidet (`10`, Abschnitt 2.1) |
|
||||
| Review-Gate | Die korrigierte Architektur reicht als Grundlage der Implementierungsplanung, mit **einer** blockierenden Voraussetzung: der Stapelwahl (`13`, Abschnitt 10) |
|
||||
| Technologie | **Beschlossen am 15.11.2026:** Laravel 13, Filament 5, PHP 8.4, PostgreSQL (ADR-02). Die frühere Empfehlung „Django + Wagtail, knapp“ gilt nicht |
|
||||
| Review-Gate | Die Stapelwahl blockiert die Umsetzung nicht mehr. Offen bleiben die Geschäftsentscheidungen in `13`, die den Verkaufsstart betreffen |
|
||||
|
||||
---
|
||||
|
||||
@@ -133,7 +133,7 @@ ## 7. Entscheidungen, die als Nächstes anstehen
|
||||
|---|---|---|
|
||||
| 1 | Die Korrekturen der Challenger-Prüfung bestätigen oder zurückweisen, insbesondere die ersetzten ADR-02, ADR-09, ADR-10, die neuen ADR-23 bis ADR-27 und die Annahme A-14 | `13`, Abschnitte 9 und 10; `12` |
|
||||
| 2 | Gesamtarchitektur mit den beiden Auflagen bestätigen oder verwerfen | ADR-01, `02`, Abschnitt 7 |
|
||||
| 3 | **Machbarkeitsnachweis zur Stapelwahl beauftragen, danach Kernstapel entscheiden** – die einzige Voraussetzung, die die Implementierungsplanung blockiert | E-18; `10`, Abschnitt 2.1 |
|
||||
| 3 | Kernstapel ist entschieden (ADR-02, 15.11.2026). Kein weiterer Machbarkeitsnachweis | E-18 erledigt |
|
||||
| 4 | Freigabe einer rein lesenden Bestandsprüfung am Server | A-05 bis A-08 |
|
||||
| 5 | Ziele für Datenverlust und Wiederanlauf festlegen; Außer-Haus-Sicherungsziel wählen | E-22, A-15 |
|
||||
| 6 | Steuerstatus, Kundenkreis, Zahlungs- und Rechnungsweg | OPEN-06, E-09 |
|
||||
|
||||
@@ -176,7 +176,7 @@ ### 8.1 Einschätzung für den Kern nach der Challenger-Prüfung
|
||||
|
||||
**Was gegen S2 spricht:** Entwurf, Vorschau, Revisionen und Wiederherstellung für Seiten sind Eigenbau oder Zukauf. Das vorhandene Sektionssystem des FewoPortals bietet dafür laut dessen Projektbeschreibung keine Grundlage über die Bausteinidee hinaus. Dieser Aufwand wird leicht unterschätzt.
|
||||
|
||||
**Einschätzung:** Die Wahl ist **offen**. Keine Fachanforderung entscheidet sie; beide Stapel tragen die Zielarchitektur aus `03` bis `09`, die deshalb weiterhin stapelneutral formuliert ist. Unter dem gegebenen Betriebsrahmen spricht mehr für S2, **sofern** die Redaktionsanforderung WEB-005 dort mit vertretbarem Aufwand erfüllbar ist. S1 ist vorzuziehen, wenn redaktionelle Freiheit und Freigabeabläufe für Seiten hoch gewichtet werden oder der Nachweis für S2 scheitert.
|
||||
**Einschätzung:** **Seit dem 15.11.2026 entschieden: Laravel 13, Filament 5, PostgreSQL (ADR-02).** Der Vergleich davor: Keine Fachanforderung entscheidet sie; beide Stapel tragen die Zielarchitektur aus `03` bis `09`, die deshalb weiterhin stapelneutral formuliert ist. Unter dem gegebenen Betriebsrahmen spricht mehr für S2, **sofern** die Redaktionsanforderung WEB-005 dort mit vertretbarem Aufwand erfüllbar ist. S1 ist vorzuziehen, wenn redaktionelle Freiheit und Freigabeabläufe für Seiten hoch gewichtet werden oder der Nachweis für S2 scheitert.
|
||||
|
||||
**Nicht empfohlen** bleiben S4 (entspricht Variante B) und S3 (anstehender Hauptversionswechsel, kein erkennbarer Vorteil für dieses Vorhaben).
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ ## 1. Bestandsumgebung (lesende Sichtung)
|
||||
|
||||
## 2. Kernanwendung: Framework und CMS
|
||||
|
||||
**Beschlossen am 15.11.2026 (ADR-02):** Laravel 13, Filament 5, PHP 8.4, PostgreSQL, server-gerendert. Die Tabelle bleibt der Vergleich, der zu dieser Entscheidung geführt hat. Die Urteile „Entscheidung offen“ sind damit überholt.
|
||||
|
||||
| Kandidat | Stand und Lizenz | Redaktion | Eignung für den Lizenzkern | Betrieb | Urteil |
|
||||
|---|---|---|---|---|---|
|
||||
| **Django + Wagtail** | Wagtail 7.4 ist LTS (05.05.2026), verlangt Django 5.2 oder neuer, Sicherheitskorrekturen bis 02.11.2027; die Linie 8.x ist erschienen (stabile Dokumentation 8.1), nächste LTS 8.3 für Mai 2027 geplant [B][1][61]. Django 5.2 LTS wird bis April 2028 gepflegt, 6.2 LTS ist für April 2027 angekündigt; ab 2028 jährliche Veröffentlichungen mit je drei Jahren Unterstützung [B][4][60]. BSD-Lizenz [E]. | Für **Seiten**: Seitenbaum, Bausteinfelder, Entwurf, Vorschau, Revisionen mit Vergleich, Freigabe-Workflows, zeitgesteuerte Veröffentlichung. Für andere Objekte sind Entwurf, Revision, Vorschau und Workflow einzeln zuschaltbar [B][55]. | relationales ORM mit Transaktionen und Datenbank-Constraints. Der Aufgabenrahmen des Frameworks liefert **keine ausführende Komponente**; eine dauerhafte Warteschlange braucht ein Zusatzpaket [B][57]. | ein Prozess plus Worker; Container | **Kandidat A** – Entscheidung offen, siehe 2.1 |
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
# 12 – Entscheidungsprotokoll (ADR)
|
||||
|
||||
Status aller Einträge: **vorgeschlagen**. Die Entscheidung liegt beim Auftraggeber. Kein Eintrag gibt eine Technologie als vorgegeben aus. ADRs sind Architekturvorschläge, keine Fachregeln.
|
||||
Status der Einträge: **vorgeschlagen**, sofern nicht anders vermerkt. Die Entscheidung liegt beim Auftraggeber. ADRs sind Architekturvorschläge, keine Fachregeln.
|
||||
|
||||
**ADR-02 ist am 15.11.2026 beschlossen:** Laravel 13, Filament 5, PHP 8.4, PostgreSQL, server-gerendert. Die Umsetzung hat begonnen. Die übrigen Einträge bleiben Vorschläge.
|
||||
|
||||
**Stand nach der Challenger-Prüfung vom 14.11.2026** (`13`, Abschnitte 8 und 9): ADR-02, ADR-09 und ADR-10 sind **ersetzt**; ADR-01, ADR-11, ADR-12, ADR-14, ADR-18 und ADR-20 sind **ergänzt**; ADR-23 bis ADR-27 sind **neu**. Die übrigen wurden geprüft und unverändert beibehalten. Die frühere Fassung der ersetzten Einträge ist jeweils unter „Abgelöst“ in einem Satz festgehalten.
|
||||
|
||||
| Nr. | Thema | Empfehlung in einem Satz |
|
||||
|---|---|---|
|
||||
| ADR-01 | Gesamtarchitektur | Integrierter modularer Kern mit Community als Satellit, mit getrennten Rechten im Innern |
|
||||
| ADR-02 | Stapel des Kerns | **Offen:** Laravel + Filament oder Django + Wagtail auf PostgreSQL; Entscheidung nach abgegrenztem Machbarkeitsnachweis |
|
||||
| ADR-02 | Stapel des Kerns | **Beschlossen (15.11.2026):** Laravel 13, Filament 5, PHP 8.4, PostgreSQL, server-gerendert |
|
||||
| ADR-03 | Vier Ebenen des Produktmodells | Inhalt, Lizenzartikel, Angebot, Berechtigung mit je eigener Identität |
|
||||
| ADR-04 | Artikelgrenze | ausdrückliche Deklaration, keine Ableitung aus dem Inhaltsgraphen |
|
||||
| ADR-05 | Berechtigung als unteilbares Bündel | Entscheidung je einzelner Berechtigung, nie Vereinigung |
|
||||
@@ -48,10 +50,10 @@ ## ADR-01 – Integrierter modularer Kern mit Community-Satellit
|
||||
## ADR-02 – Technologiestapel des Kerns (ersetzt)
|
||||
|
||||
**Kontext.** Redaktionsarbeitsplatz (WEB-005), Lizenzkern mit umfangreicher Verwaltung, Hintergrundverarbeitung, Medienverarbeitung; ein Betreiber mit begrenzter Wartungszeit, der Laravel/Filament aktuell betreibt und Python/PostgreSQL/Docker kennt.
|
||||
**Entscheidung.** **Noch keine.** Zwei tragfähige Kandidaten: Laravel + Filament oder Django + Wagtail, jeweils auf PostgreSQL, server-gerendert. Unter dem gegebenen Betriebsrahmen spricht mehr für Laravel + Filament, sofern die Redaktionsanforderung für Seiten dort mit vertretbarem Aufwand erfüllbar ist. Das entscheidet ein abgegrenzter Machbarkeitsnachweis mit festem Abbruchkriterium (`10`, Abschnitt 2.1).
|
||||
**Entscheidung.** **Beschlossen am 15.11.2026 mit Beginn der Umsetzung:** Laravel 13, Filament 5, PHP 8.4 und PostgreSQL. Die Seiten sind server-gerendert; Entwurf, Vorschau, Veröffentlichung und Wiederherstellung einer Revision sind Bestandteil der Anwendung. Der frühere Vergleich bleibt als Begründung stehen: Unter dem Betriebsrahmen sprach mehr für Laravel + Filament. Der Machbarkeitsnachweis aus `10`, Abschnitt 2.1, wird durch die laufende Umsetzung ersetzt und nicht erneut als Studie geführt.
|
||||
**Alternativen.** Next.js + Payload; FastAPI + React + Headless CMS (beide weiterhin nicht empfohlen).
|
||||
**Begründung.** Keine Fachanforderung entscheidet zwischen den beiden Kandidaten. Django + Wagtail bringt die Redaktion öffentlicher Seiten fertig mit und hat längere Pflegezeiträume. Laravel + Filament bringt die Verwaltungsoberflächen des Lizenzkerns (größter Einzelaufwand), die Hintergrundverarbeitung und die vorhandene Betriebserfahrung mit und vermeidet einen dritten Stapel.
|
||||
**Folgen.** Stufe A0 enthält den Machbarkeitsnachweis. Die Zielarchitektur bleibt stapelneutral. Die Entscheidung ist umkehrbar bis zum Beginn der Umsetzung, danach nicht mehr mit vertretbarem Aufwand.
|
||||
**Folgen.** Die Umsetzung hat begonnen. Ein Wechsel des Stapels ist nicht mehr mit vertretbarem Aufwand möglich. Die Modulgrenzen aus `03` bleiben bestehen; die Formulierung älterer Kapitel ist weiterhin stapelneutral und wird nicht neu geschrieben.
|
||||
**Abgelöst.** Frühere Fassung: „Django + Wagtail, knapp, wegen fertiger Redaktion und Medienwerkzeugen im selben Sprachraum“. Das Medienargument hielt der Prüfung nicht stand, das Redaktionsargument nur für öffentliche Seiten (Befunde CH-52, CH-53).
|
||||
|
||||
## ADR-03 – Vier Ebenen des Produktmodells
|
||||
|
||||
@@ -105,7 +105,7 @@ ## 4. Offene fachliche Entscheidungen
|
||||
| OPEN-05 | Co-Branding- und Kennzeichnungsverfahren | Stufen K0–K4; Tiefe des Video-Brandings | Stufenmodell | K0–K2 vor A2; K4 nach Versuch |
|
||||
| OPEN-06 | Zahlungs-, Rechnungs-, Steuerweg | direkter Zahlungsdienst mit eigener Rechnungsstellung / Verkäufermodell (`10`, Abschnitt 6 und 7) | Adapter | **früh**: vor Beginn der Umsetzung von A1, nach Steuerberatung |
|
||||
| OPEN-07 | Community-Sichtbarkeit, Kontakt, Moderation | öffentlich lesbar oder nur Mitglieder; Kontaktwege; Moderationsteam | Konfiguration je Bereich und je Profilangabe | vor A3 |
|
||||
| OPEN-08 | Konkrete Technologien | `10` | ADR-02, ADR-12, ADR-14, ADR-16 | Kernstapel vor A0-Abschluss |
|
||||
| OPEN-08 | Konkrete Technologien | `10` | ADR-12, ADR-14, ADR-16 bleiben offen. **ADR-02 ist am 15.11.2026 beschlossen** (Laravel 13, Filament 5, PostgreSQL) | Kernstapel erledigt |
|
||||
| E-09 | Dürfen Verbraucher kaufen? | ja mit Widerrufsablauf / nur Unternehmer | Kundenart an der Bestellung | vor A1 |
|
||||
| E-10 | Verhalten kostenloser Berechtigungen bei Angebotsende (L-04) | dauerhaft / solange aktiv / befristet | Laufzeitregel | vor dem ersten kostenlosen Angebot |
|
||||
| E-11 | Teilerstattung von Paketen (L-06) | Positionswahl / Kulanz ohne Rechteänderung | geführter Vorgang | vor A2 |
|
||||
@@ -115,7 +115,7 @@ ## 4. Offene fachliche Entscheidungen
|
||||
| E-15 | Umgang mit geladenen Dateien nach Ablauf oder Erstattung (L-13) | Weiternutzung / Löschpflicht | Vertragstext; Nachweis | vor A2 |
|
||||
| E-16 | Aufbewahrungsfristen für Nachweise und Protokolle | `11`, Abschnitt 8.3 | Konfiguration | vor A1 |
|
||||
| E-17 | Vier-Augen-Prinzip für Freigabe und manuelle Vergabe | aus / an | Konfiguration | jederzeit änderbar |
|
||||
| E-18 | Kernstapel: Laravel + Filament oder Django + Wagtail | Entscheidung nach dem Machbarkeitsnachweis mit Abbruchkriterium (`10`, Abschnitt 2.1; `02`, Abschnitt 8) | ADR-02 | vor Beginn von A1 |
|
||||
| E-18 | Kernstapel | **Entschieden am 15.11.2026:** Laravel 13, Filament 5, PHP 8.4, PostgreSQL | ADR-02 | erledigt |
|
||||
| E-19 | Kriterien des Betreibers für „neue Fassung desselben Artikels“ gegen „eigenständiges neues Produkt“ (VER-010) | eigene Kriterienliste; Orientierung in `06`, Abschnitt 7.2 | Einordnungspflicht mit Begründung; Auswirkungsbericht | vor der ersten Überarbeitung eines verkauften Artikels |
|
||||
| E-20 | Sind auch Stände zugänglich, die vor dem Erwerb abgelöst wurden (Annahme A-14)? In welchen Fällen wird bei der Sperre einer Altfassung aktiv informiert? | ja / nur ab Erwerb; je Vorgang entschieden | eine Bedingung; Benachrichtigung je Vorgang | vor der ersten Überarbeitung eines verkauften Artikels |
|
||||
| E-21 | Upgrades: Preisformel; abhängig oder eigenständig je Upgrade-Angebot; Laufzeit im Verhältnis zur Ausgangslizenz (LIC-012 lässt das offen) | Differenzpreis mit Abhängigkeit / Vollpreis eigenständig | Bedingung in Angebotsfassung und Bestellung (`05`, Abschnitt 8.2) | vor A2 |
|
||||
@@ -123,7 +123,7 @@ ## 4. Offene fachliche Entscheidungen
|
||||
| E-23 | Sollen Institutionen schon vor Stufe A4 bedient werden? | (a) nein, bis A4 warten; (b) A4 vorziehen; (c) Institution bezahlt klar so benannte **persönliche** Lizenzen namentlich bestimmter Trainer, die beim Trainer bleiben | Angebotsfassung trägt die Inhaberart; keine Organisationsangebote im ersten Schnitt | vor dem ersten Anliegen einer Institution |
|
||||
| E-24 | Community-Produkt und Betriebsform (selbst betrieben oder gehostet) | `10`, Abschnitt 4 | ADR-12 | vor A3, nach dem kleinen Nachweis aus `10`, Abschnitt 11 Nr. 2 |
|
||||
|
||||
**Früh nötige Geschäftsentscheidungen** (LIC-011 verlangt deren Benennung): OPEN-06 mit Steuerstatus, E-09 Kundenkreis, OPEN-03 Lizenztypen und Preise der ersten Angebote, E-22 Wiederherstellungsziele, E-18 Kernstapel. Die Updatepolitik (früher OPEN-01) ist entschieden und steht nicht mehr auf dieser Liste.
|
||||
**Früh nötige Geschäftsentscheidungen** (LIC-011 verlangt deren Benennung): OPEN-06 mit Steuerstatus, E-09 Kundenkreis, OPEN-03 Lizenztypen und Preise der ersten Angebote, E-22 Wiederherstellungsziele. Die Updatepolitik (früher OPEN-01) und der Kernstapel (E-18, 15.11.2026) sind entschieden und stehen nicht mehr auf dieser Liste.
|
||||
|
||||
## 5. Wie weit trägt die technische Planung ohne die Geschäftsentscheidungen?
|
||||
|
||||
@@ -139,7 +139,7 @@ ## 5. Wie weit trägt die technische Planung ohne die Geschäftsentscheidungen?
|
||||
| Betrieb | vollständig nach Bestandsprüfung | Zielhöhe der Wiederherstellung (E-22) |
|
||||
| Sicherheit | Grenzen, Rollen, Negativtests vollständig | – |
|
||||
|
||||
Keine offene Geschäftsregel verhindert den Beginn der Umsetzung. Mehrere verhindern den **Verkaufsstart**. Vor dem Beginn von Stufe A1 steht allein die Wahl des Kernstapels (E-18).
|
||||
Keine offene Geschäftsregel verhindert den Beginn der Umsetzung. Mehrere verhindern den **Verkaufsstart**. Die Wahl des Kernstapels (E-18) ist am 15.11.2026 getroffen.
|
||||
|
||||
## 6. Ehrliche Aufwandseinordnung
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ ### A0 – Fundament und Nachweise
|
||||
| Arbeitspaket | Ergebnis |
|
||||
|---|---|
|
||||
| Bestandsprüfung am Server (lesend): Ressourcen, Anbindung, Erreichbarkeit, Reverse Proxy, NAS, Gitea, Netztrennung zum privaten Netz | Annahmen A-05 bis A-08 bestätigt oder korrigiert |
|
||||
| **Machbarkeitsnachweis Kernstapel** mit vier Punkten und Abbruchkriterium (`10`, Abschnitt 2.1) | Grundlage für E-18 |
|
||||
| Entscheidung Kernstapel (E-18) | ADR-02 beschlossen; **einzige Voraussetzung, die die Implementierungsplanung blockiert** (`13`, Abschnitt 10) |
|
||||
| **Machbarkeitsnachweis Kernstapel** | durch die Umsetzung ab dem 15.11.2026 ersetzt, nicht als eigene Studie wiederholt |
|
||||
| Entscheidung Kernstapel (E-18) | **erledigt am 15.11.2026:** Laravel 13, Filament 5, PHP 8.4, PostgreSQL (ADR-02) |
|
||||
| **Sicherheitsbasis:** drei Herkunftsadressen; getrennte Datenbankrollen und Einhängepunkte je Betriebsart; Alltags- und Systemkonto; Alarmkanal außerhalb der Plattform | Grenzen aus `03`, Abschnitt 6 stehen, bevor Fachcode entsteht |
|
||||
| **Sicherungsbasis:** Außer-Haus-Ziel mit nur anfügbarem Zugang ausgewählt (A-15); fortlaufendes Änderungsprotokoll an beide Ziele; Spiegel von Quellcode und Abbildern; Sicherheitsjournal und Audit-Anker; Entscheidung über die Ziele (E-22) | `11`, Abschnitt 3 eingerichtet; erste Standortausfall-Übung mit Zeitmessung |
|
||||
| Steuer- und Rechtsberatung: Steuerstatus, Kundenkreis, Zahlungs- und Rechnungsweg, Bestellablauf, Lizenzbedingungen | OPEN-06, E-09 entschieden; Textaufträge erteilt |
|
||||
|
||||
@@ -128,7 +128,7 @@ ### 6.1 Entscheidungen, die vorliegen müssen
|
||||
|
||||
| Entscheidung | Verweis |
|
||||
|---|---|
|
||||
| Kernstapel, nach dem Machbarkeitsnachweis | E-18 |
|
||||
| Kernstapel | E-18, **entschieden am 15.11.2026:** Laravel 13, Filament 5, PostgreSQL |
|
||||
| Steuerstatus, Kundenkreis, Zahlungs- und Rechnungsweg | OPEN-06, E-09 |
|
||||
| Lizenztypen, Preise und Bedingungen der Startangebote | OPEN-03 |
|
||||
| Ziele für Datenverlust und Wiederanlauf | E-22 |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# LUF – Deployment (Stand 2026-11-15)
|
||||
|
||||
Abgeleitet aus dem Shinkan-Verfahren, siehe [Bestandsaufnahme_Deployment_2026-11-15.md](Bestandsaufnahme_Deployment_2026-11-15.md).
|
||||
**Status: geschrieben, aber noch nicht gelaufen.** Es gibt noch keine Laravel-Anwendung im Repo (kommt mit U0), und lokal stehen weder Docker noch Composer zur Verfügung. Geprüft wurden nur Shell-Syntax und YAML.
|
||||
**Status: Anwendung U0 liegt im Repo. Ein Deploy ist erst gelaufen, wenn ein Push auf `develop` den Workflow grün durchlaufen hat.** Lokal gibt es PHP 8.4 und Node. Docker liegt auf dem Runner, nicht auf dem Entwicklungsrechner.
|
||||
|
||||
## Ablauf
|
||||
|
||||
@@ -66,10 +66,10 @@ ## Annahmen und offene Punkte
|
||||
|
||||
- **Repository-Zugriff der Runner [?]:** Die Workflows klonen `http://192.168.2.144:3000/Lars/laraundfelix.git` ohne Zugangsdaten, wie Shinkan. Ist das Repository privat und der Runner nicht angemeldet, schlägt der Clone fehl.
|
||||
- **Gitea-Actions-Syntax [?]:** `needs:` und `github.sha` sind Standard, wurden aber auf dieser Gitea-Version nicht ausprobiert. `actions/checkout` wird bewusst nicht benutzt.
|
||||
- **Laravel-Gerüst fehlt:** Das Dockerfile erwartet `composer.json`, `composer.lock`, `package.json` und `npm run build` im Repo-Root, außerdem die Standardroute `/up`.
|
||||
- **Laravel-Gerüst:** `composer.json`, `composer.lock`, `package.json` und `package-lock.json` liegen im Root. Die Health-Route ist `/up`. Das Image veröffentlicht die Filament-Assets beim Bau (`php artisan filament:assets`) und baut das Frontend mit `npm run build`.
|
||||
- **Zeilenenden:** `.gitattributes` erzwingt LF für Skripte, weil lokal `core.autocrlf=true` gesetzt ist.
|
||||
- **Öffentliche Uploads:** Der Web-Container hat kein `storage`-Volume. Werden Dateien über `storage:link` ausgeliefert, muss das mit U0 geklärt werden.
|
||||
- **Reverse Proxy:** Laravel braucht vertrauenswürdige Proxys (`X-Forwarded-Proto`), sonst stimmen `https`-URLs nicht. In U0 konfigurieren.
|
||||
- **Öffentliche CMS-Bilder:** Der Web-Prozess schreibt nicht nach `/media/public`. Ein Upload liegt zuerst auf dem beschreibbaren Storage-Volume (`cms_incoming`). Die Queue kopiert nach `/media/public`. Ausgeliefert wird die Datei über die Anwendung unter `/medien/…`, zuerst aus dem öffentlichen Medienpfad, ersatzweise aus dem Eingang. `storage:link` wird dafür nicht gebraucht. Die Env-Datei braucht `MEDIA_PUBLIC_PATH`, `MEDIA_DERIVED_PATH` und `MEDIA_ORIGINALS_PATH` (siehe `deploy/luf.env.example`).
|
||||
- **Reverse Proxy:** Die Anwendung vertraut weitergeleiteten Proxy-Kopfzeilen. Nginx reicht `X-Forwarded-Proto`, `X-Forwarded-Host`, `X-Forwarded-Port` und `X-Forwarded-For` an PHP weiter. Der Proxy vor dem Container muss `X-Forwarded-Proto` setzen, damit Adressen `https` bleiben.
|
||||
- **Queue:** Datenbank-Queue (`QUEUE_CONNECTION=database`), kein Redis. Reicht für den Start.
|
||||
- **Gate vor Prod:** Merge-Schutz ist eine Gitea-Einstellung und gehört nicht in die Workflows.
|
||||
- **Umzug Test auf den Pi:** Werte oben in `deploy-test.yml` ändern (Label `ubuntu-latest`, Guard auf `raspberrypi5`/`aarch64`, Pfade, Port). Das Dockerfile baut auch für ARM64. Vorher Speicherlage auf dem Pi klären.
|
||||
Generated
+2281
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"$schema": "https://www.schemastore.org/package.json",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"concurrently": "^10.0.3",
|
||||
"laravel-vite-plugin": "^3.1",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"vite": "^8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@laravel/multiplex": "^0.4.1"
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory>tests/Unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Feature">
|
||||
<directory>tests/Feature</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<source>
|
||||
<include>
|
||||
<directory>app</directory>
|
||||
</include>
|
||||
</source>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||
<env name="BROADCAST_CONNECTION" value="null"/>
|
||||
<env name="CACHE_STORE" value="array"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="DB_URL" value=""/>
|
||||
<env name="MAIL_MAILER" value="array"/>
|
||||
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="PULSE_ENABLED" value="false"/>
|
||||
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||
<env name="NIGHTWATCH_ENABLED" value="false"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
@@ -0,0 +1,25 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
<IfModule mod_negotiation.c>
|
||||
Options -MultiViews -Indexes
|
||||
</IfModule>
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
# Handle Authorization Header
|
||||
RewriteCond %{HTTP:Authorization} .
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
|
||||
# Handle X-XSRF-Token Header
|
||||
RewriteCond %{HTTP:x-xsrf-token} .
|
||||
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
|
||||
|
||||
# Redirect Trailing Slashes If Not A Folder...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} (.+)/$
|
||||
RewriteRule ^ %1 [L,R=301]
|
||||
|
||||
# Send Requests To Front Controller...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [L]
|
||||
</IfModule>
|
||||
Whitespace-only changes.
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
// Determine if the application is in maintenance mode...
|
||||
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||
require $maintenance;
|
||||
}
|
||||
|
||||
// Register the Composer autoloader...
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the request...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->handleRequest(Request::capture());
|
||||
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
@@ -0,0 +1,331 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
@theme {
|
||||
--font-sans: 'Source Sans 3', 'Segoe UI', sans-serif;
|
||||
--font-serif: 'Source Serif 4', Georgia, serif;
|
||||
--color-ink: #1b2838;
|
||||
--color-paper: #e7eee9;
|
||||
--color-sheet: #f7faf8;
|
||||
--color-pine: #0f6e56;
|
||||
--color-line: #c5d2cb;
|
||||
}
|
||||
|
||||
html {
|
||||
background: var(--color-paper);
|
||||
color: var(--color-ink);
|
||||
font-family: var(--font-sans);
|
||||
font-size: 1.0625rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-pine);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 3px solid #0b5cab;
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.skip {
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
top: -4rem;
|
||||
background: white;
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
|
||||
.skip:focus {
|
||||
top: 1rem;
|
||||
}
|
||||
|
||||
.masthead {
|
||||
background: var(--color-ink);
|
||||
color: #f4f7f5;
|
||||
}
|
||||
|
||||
.masthead a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.masthead-inner,
|
||||
.sheet,
|
||||
.site-footer-inner {
|
||||
width: min(72rem, calc(100% - 2rem));
|
||||
margin-inline: auto;
|
||||
}
|
||||
|
||||
.wordmark {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
align-items: baseline;
|
||||
padding-top: 1.5rem;
|
||||
}
|
||||
|
||||
.wordmark strong {
|
||||
font-family: var(--font-serif);
|
||||
font-size: clamp(2rem, 4vw, 3.25rem);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.wordmark span {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem 1.1rem;
|
||||
padding: 1.25rem 0 1.1rem;
|
||||
border-top: 1px solid rgb(255 255 255 / 18%);
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
|
||||
.site-nav a[aria-current='page'] {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.35rem;
|
||||
}
|
||||
|
||||
.sheet {
|
||||
background: var(--color-sheet);
|
||||
padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.preview-banner {
|
||||
background: #fff4d6;
|
||||
color: #3d2e04;
|
||||
padding: 0.75rem 1rem;
|
||||
margin: -1rem -1rem 1.5rem;
|
||||
}
|
||||
|
||||
.block + .block {
|
||||
margin-top: 2.25rem;
|
||||
}
|
||||
|
||||
main h1 {
|
||||
font-family: var(--font-serif);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1.15;
|
||||
font-size: clamp(2rem, 4vw, 3rem);
|
||||
margin: 0 0 0.75rem;
|
||||
}
|
||||
|
||||
.block h1,
|
||||
.block h2 {
|
||||
font-family: var(--font-serif);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1.15;
|
||||
margin: 0 0 0.75rem;
|
||||
}
|
||||
|
||||
.block h1 {
|
||||
font-size: clamp(2.4rem, 6vw, 4.4rem);
|
||||
max-width: 12ch;
|
||||
}
|
||||
|
||||
.block h2 {
|
||||
font-size: clamp(1.8rem, 3vw, 2.6rem);
|
||||
max-width: 18ch;
|
||||
}
|
||||
|
||||
.lede,
|
||||
.prose,
|
||||
.cta p,
|
||||
.card p,
|
||||
.faq dd {
|
||||
max-width: 62ch;
|
||||
}
|
||||
|
||||
.lede {
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.45;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.prose p {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
|
||||
gap: 1rem;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card {
|
||||
border-top: 3px solid var(--color-pine);
|
||||
background: white;
|
||||
padding: 1rem 1rem 1.15rem;
|
||||
}
|
||||
|
||||
.card h3 {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 1.35rem;
|
||||
margin: 0 0 0.4rem;
|
||||
}
|
||||
|
||||
.card a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.card a:hover h3 {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.cta {
|
||||
background: var(--color-ink);
|
||||
color: #f4f7f5;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.cta h2,
|
||||
.cta p {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.cta a {
|
||||
display: inline-block;
|
||||
margin-top: 0.8rem;
|
||||
background: #f4f7f5;
|
||||
color: var(--color-ink);
|
||||
text-decoration: none;
|
||||
padding: 0.55rem 0.9rem;
|
||||
}
|
||||
|
||||
.image-text {
|
||||
display: grid;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
@media (min-width: 48rem) {
|
||||
.image-text {
|
||||
grid-template-columns: minmax(12rem, 16rem) 1fr;
|
||||
align-items: start;
|
||||
}
|
||||
}
|
||||
|
||||
.image-text img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.faq {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.faq dt {
|
||||
font-weight: 600;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.faq dd {
|
||||
margin: 0.25rem 0 0;
|
||||
}
|
||||
|
||||
.member-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem 1.25rem;
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid var(--color-line);
|
||||
}
|
||||
|
||||
.member-nav a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.member-nav a[aria-current='page'] {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.3rem;
|
||||
}
|
||||
|
||||
.empty {
|
||||
background: white;
|
||||
border: 1px solid var(--color-line);
|
||||
padding: 1.25rem;
|
||||
max-width: 62ch;
|
||||
}
|
||||
|
||||
.form {
|
||||
display: grid;
|
||||
gap: 0.9rem;
|
||||
max-width: 28rem;
|
||||
}
|
||||
|
||||
.form label {
|
||||
display: grid;
|
||||
gap: 0.3rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.form input {
|
||||
font: inherit;
|
||||
padding: 0.55rem 0.65rem;
|
||||
border: 1px solid #8ea399;
|
||||
background: white;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form button,
|
||||
.button {
|
||||
font: inherit;
|
||||
background: var(--color-pine);
|
||||
color: white;
|
||||
border: 0;
|
||||
padding: 0.6rem 0.9rem;
|
||||
width: fit-content;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.check {
|
||||
font-weight: 400;
|
||||
grid-template-columns: auto 1fr;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.errors {
|
||||
background: #fde8e4;
|
||||
color: #6d2016;
|
||||
padding: 0.75rem 1rem;
|
||||
}
|
||||
|
||||
.status {
|
||||
background: #e5f4ec;
|
||||
padding: 0.75rem 1rem;
|
||||
}
|
||||
|
||||
.site-footer {
|
||||
padding: 2rem 0 3rem;
|
||||
}
|
||||
|
||||
.site-footer nav {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.site-footer a {
|
||||
color: inherit;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
//
|
||||
@@ -0,0 +1,17 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Passwort vergessen')
|
||||
|
||||
@section('content')
|
||||
<h1>Passwort zurücksetzen</h1>
|
||||
<form class="form" method="post" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
<label>E-Mail
|
||||
<input name="email" type="email" value="{{ old('email') }}" required autocomplete="email">
|
||||
</label>
|
||||
@error('email')
|
||||
<p class="errors">{{ $message }}</p>
|
||||
@enderror
|
||||
<button type="submit">Link senden</button>
|
||||
</form>
|
||||
@endsection
|
||||
@@ -0,0 +1,29 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Anmelden')
|
||||
|
||||
@section('content')
|
||||
<h1>Anmelden</h1>
|
||||
@if ($errors->any())
|
||||
<div class="errors" role="alert">
|
||||
@foreach ($errors->all() as $error)
|
||||
<p>{{ $error }}</p>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
<form class="form" method="post" action="{{ route('login') }}">
|
||||
@csrf
|
||||
<label>E-Mail
|
||||
<input name="email" type="email" value="{{ old('email') }}" required autocomplete="username">
|
||||
</label>
|
||||
<label>Passwort
|
||||
<input name="password" type="password" required autocomplete="current-password">
|
||||
</label>
|
||||
<label class="check">
|
||||
<input type="checkbox" name="remember" value="1">
|
||||
<span>Angemeldet bleiben</span>
|
||||
</label>
|
||||
<button type="submit">Anmelden</button>
|
||||
</form>
|
||||
<p><a href="{{ route('password.request') }}">Passwort vergessen</a></p>
|
||||
@endsection
|
||||
@@ -0,0 +1,35 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Registrieren')
|
||||
|
||||
@section('content')
|
||||
<h1>Registrieren</h1>
|
||||
<p class="lede">Die Plattform ist für Erwachsene, die Präventionsangebote durchführen. Kinder brauchen kein Konto.</p>
|
||||
@if ($errors->any())
|
||||
<div class="errors" role="alert">
|
||||
@foreach ($errors->all() as $error)
|
||||
<p>{{ $error }}</p>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
<form class="form" method="post" action="{{ route('register') }}">
|
||||
@csrf
|
||||
<label>Name
|
||||
<input name="name" value="{{ old('name') }}" required autocomplete="name">
|
||||
</label>
|
||||
<label>E-Mail
|
||||
<input name="email" type="email" value="{{ old('email') }}" required autocomplete="email">
|
||||
</label>
|
||||
<label>Passwort
|
||||
<input name="password" type="password" required autocomplete="new-password">
|
||||
</label>
|
||||
<label>Passwort wiederholen
|
||||
<input name="password_confirmation" type="password" required autocomplete="new-password">
|
||||
</label>
|
||||
<label class="check">
|
||||
<input type="checkbox" name="adult" value="1" @checked(old('adult'))>
|
||||
<span>Ich bin volljährig und lege das Konto für mich selbst an.</span>
|
||||
</label>
|
||||
<button type="submit">Konto anlegen</button>
|
||||
</form>
|
||||
@endsection
|
||||
@@ -0,0 +1,28 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Neues Passwort')
|
||||
|
||||
@section('content')
|
||||
<h1>Neues Passwort</h1>
|
||||
<form class="form" method="post" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
<label>E-Mail
|
||||
<input name="email" type="email" value="{{ old('email', $email) }}" required autocomplete="email">
|
||||
</label>
|
||||
<label>Neues Passwort
|
||||
<input name="password" type="password" required autocomplete="new-password">
|
||||
</label>
|
||||
<label>Passwort wiederholen
|
||||
<input name="password_confirmation" type="password" required autocomplete="new-password">
|
||||
</label>
|
||||
@if ($errors->any())
|
||||
<div class="errors" role="alert">
|
||||
@foreach ($errors->all() as $error)
|
||||
<p>{{ $error }}</p>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
<button type="submit">Passwort speichern</button>
|
||||
</form>
|
||||
@endsection
|
||||
@@ -0,0 +1,12 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'E-Mail bestätigen')
|
||||
|
||||
@section('content')
|
||||
<h1>E-Mail bestätigen</h1>
|
||||
<p>Wir haben Ihnen eine Nachricht geschickt. Der Mitgliederbereich öffnet sich, sobald die Adresse bestätigt ist.</p>
|
||||
<form method="post" action="{{ route('verification.send') }}">
|
||||
@csrf
|
||||
<button class="button" type="submit">Nachricht erneut senden</button>
|
||||
</form>
|
||||
@endsection
|
||||
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>@yield('title', config('app.name'))</title>
|
||||
@hasSection('description')
|
||||
<meta name="description" content="@yield('description')">
|
||||
@endif
|
||||
@hasSection('canonical')
|
||||
<link rel="canonical" href="@yield('canonical')">
|
||||
@endif
|
||||
@fonts
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip" href="#inhalt">Zum Inhalt</a>
|
||||
<header class="masthead">
|
||||
<div class="masthead-inner">
|
||||
<div class="wordmark">
|
||||
<a href="{{ route('home') }}"><strong>Lara & Felix</strong></a>
|
||||
<span>Stark im Alltag</span>
|
||||
</div>
|
||||
<nav class="site-nav" aria-label="Hauptnavigation">
|
||||
@foreach (($navigation ?? collect())->where('placement', 'header') as $item)
|
||||
@if ($item->href())
|
||||
<a href="{{ $item->href() }}" @if(isset($page) && $item->page_id === $page->id) aria-current="page" @endif>{{ $item->label }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@auth
|
||||
<a href="{{ route('member.dashboard') }}">Mitgliederbereich</a>
|
||||
@else
|
||||
<a href="{{ route('register') }}">Registrieren</a>
|
||||
@endauth
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main id="inhalt" class="sheet">
|
||||
@if (session('status'))
|
||||
<p class="status" role="status">{{ session('status') }}</p>
|
||||
@endif
|
||||
@yield('content')
|
||||
</main>
|
||||
<footer class="site-footer">
|
||||
<div class="site-footer-inner">
|
||||
<nav aria-label="Rechtliches und Service">
|
||||
@foreach (($navigation ?? collect())->where('placement', 'footer') as $item)
|
||||
@if ($item->href())
|
||||
<a href="{{ $item->href() }}">{{ $item->label }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
</nav>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Mitgliederbereich')
|
||||
|
||||
@section('content')
|
||||
@include('member.partials.nav')
|
||||
<h1>Guten Tag, {{ auth()->user()->name }}</h1>
|
||||
<p class="lede">Hier liegen später die Materialien, die eine Berechtigung für Sie freigibt.</p>
|
||||
@endsection
|
||||
@@ -0,0 +1,11 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Berechtigungen')
|
||||
|
||||
@section('content')
|
||||
@include('member.partials.nav')
|
||||
<h1>Berechtigungen</h1>
|
||||
<div class="empty">
|
||||
<p>Ihnen ist noch keine Lizenz zugeordnet.</p>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,11 @@
|
||||
@extends('layouts.site')
|
||||
|
||||
@section('title', 'Bibliothek')
|
||||
|
||||
@section('content')
|
||||
@include('member.partials.nav')
|
||||
<h1>Bibliothek</h1>
|
||||
<div class="empty">
|
||||
<p>Ihnen ist noch kein Material zugeordnet. Sobald eine Berechtigung vorliegt, erscheinen die freigegebenen Inhalte hier. Eine Rolle allein öffnet nichts.</p>
|
||||
</div>
|
||||
@endsection
|
||||
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user