first commit
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
Kevin Adametz 2025-10-20 17:53:02 +02:00
commit 405df0a122
3083 changed files with 69203 additions and 0 deletions

216
.devcontainer/Readme.md Normal file
View file

@ -0,0 +1,216 @@
# Laravel Sail DevContainer Setup
Diese Dokumentation beschreibt die Einrichtung und Verwendung des DevContainers für das Laravel Sail-Projekt.
## Übersicht
Der DevContainer ermöglicht es, das Laravel-Projekt in einer vollständig konfigurierten Docker-Umgebung zu entwickeln, ohne dass lokale PHP-, Node.js- oder andere Abhängigkeiten installiert werden müssen.
## Voraussetzungen
- Docker Desktop installiert und laufend
- Cursor.ai oder VS Code mit DevContainer-Erweiterung
- Git (für Repository-Zugriff)
## Konfiguration
### 1. DevContainer-Konfiguration (`devcontainer.json`)
Die Hauptkonfiguration befindet sich in `.devcontainer/devcontainer.json`:
- **Eigenständiges Docker-Image**: Verwendet `sail-8.4/app` direkt ohne Docker Compose
- **Build-Konfiguration**: Definiert Build-Argumente für `WWWUSER` und `WWWGROUP`
- **Workspace**: `/var/www/html` (Standard-Laravel-Verzeichnis)
- **Benutzer**: `sail` (Laravel Sail Standard-Benutzer)
- **Features**: Leer (Tools werden über postCreateCommand installiert)
- **Extensions**: PHP, Laravel Blade, Tailwind CSS Extensions
- **Port-Forwarding**: Automatisch für wichtige Services (5173, 33061, 6380, 8025)
### 2. Dockerfile-Anpassungen (`docker/8.4/Dockerfile`)
Das Dockerfile wurde angepasst um:
- `ARG WWWUSER` hinzugefügt für korrekte Benutzer-ID
- Benutzererstellung mit dynamischen IDs (`$WWWUSER` statt feste `1337`)
- Vollständige Laravel-Umgebung mit PHP 8.4, Composer, NPM, Git
## Installation
### Automatische Installation (Empfohlen)
1. Öffnen Sie das Projekt in Cursor.ai oder VS Code
2. Klicken Sie auf "Reopen in Container" wenn die DevContainer-Benachrichtigung erscheint
3. Warten Sie bis der Container gebaut und gestartet ist
### Manuelle Installation
Falls die automatische Installation fehlschlägt, können Sie den Container manuell bauen:
```bash
cd /Users/pandora/Sites/pr-copilot.eu
docker build --build-arg WWWUSER=501 --build-arg WWWGROUP=20 -f docker/8.4/Dockerfile -t sail-8.4/app docker/8.4
```
## Verfügbare Tools
Nach der Installation sind folgende Tools verfügbar:
- **PHP 8.4.12**: Mit Xdebug für Debugging
- **Composer**: Für Laravel-Abhängigkeiten
- **NPM**: Für Frontend-Assets
- **Git**: Für Versionskontrolle
- **Node.js**: Für JavaScript-Entwicklung
Überprüfen Sie die Installation:
```bash
which git
which npm
which composer
php --version
```
## Post-Create-Befehle
Nach dem Erstellen des Containers werden automatisch ausgeführt:
1. Composer-Abhängigkeiten (`composer install`)
## Entwicklung
### Erste Schritte
1. **Composer-Abhängigkeiten**: Werden automatisch installiert
2. **Laravel-Konfiguration**: `.env` Datei muss manuell erstellt werden (siehe Laravel-Dokumentation)
3. **Datenbank-Migrationen**: `php artisan migrate`
4. **Asset-Kompilierung**: `npm install && npm run dev`
### Häufige Befehle
```bash
# Laravel-Befehle
php artisan migrate
php artisan serve
php artisan tinker
# Composer
composer install
composer update
# NPM/Node
npm install
npm run dev
npm run build
# Sail-Befehle (falls verfügbar)
./vendor/bin/sail up
./vendor/bin/sail artisan migrate
```
## Troubleshooting
### Container startet nicht
1. Überprüfen Sie ob Docker Desktop läuft
2. Stellen Sie sicher, dass keine anderen Container die benötigten Ports blockieren
3. Versuchen Sie einen Clean-Build: `docker build --no-cache ...`
### Berechtigungsprobleme
Die Container sind so konfiguriert, dass sie mit Ihrer lokalen Benutzer-ID (`501`) laufen, um Berechtigungsprobleme zu vermeiden.
### NPM Global Install Probleme
Falls Sie globale NPM-Pakete installieren möchten, verwenden Sie lokale Installation:
```bash
# Lokale Installation (empfohlen)
npm install package-name
# Oder NPM-Prefix ändern
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```
### Claude CLI Kompatibilitätsprobleme
**Problem**: Das `@anthropic-ai/claude-code` Paket ist nicht mit modernen Node.js-Versionen kompatibel.
**Symptome**:
- Viele veraltete Abhängigkeiten (deprecated packages)
- PhantomJS ARM64 Kompatibilitätsprobleme
- Engine-Konflikte mit Node.js v22
**Lösung**:
curl -fsSL https://claude.ai/install.sh | bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> /home/sail/.bashrc && source /home/sail/.bashrc
export PATH="$HOME/.local/bin:$PATH" && claude --version
### Port-Konflikte
Falls Ports bereits belegt sind, können Sie die Port-Mapping in der DevContainer-Konfiguration anpassen.
## Erweiterte Konfiguration
### Zusätzliche Extensions hinzufügen
Bearbeiten Sie `devcontainer.json` und fügen Sie Extensions zum `extensions` Array hinzu:
```json
"extensions": [
"bmewburn.vscode-intelephense-client",
"onecentlin.laravel-blade",
"shufo.vscode-blade-formatter",
"bradlc.vscode-tailwindcss",
"ihrc.vscode-php-cs-fixer"
]
```
### Zusätzliche Tools installieren
Fügen Sie Tools zum `postCreateCommand` hinzu:
```json
"postCreateCommand": "composer install --no-interaction --prefer-dist --optimize-autoloader && npm install -g your-tool"
```
## Support
Bei Problemen mit dem DevContainer:
1. Überprüfen Sie die Docker-Logs: `docker logs <container-name>`
2. Stellen Sie sicher, dass alle Umgebungsvariablen korrekt gesetzt sind
3. Versuchen Sie einen Neustart des DevContainers
## Bekannte Probleme und Lösungen
### DevContainer-CLI Kompatibilität
**Problem**: DevContainer-CLI erstellt temporäre Docker-Compose-Dateien die mit der Konfiguration kollidieren.
**Lösung**: Verwendung eines eigenständigen Docker-Images ohne Docker Compose-Abhängigkeit.
### Features-Installation
**Problem**: DevContainer Features können zu Build-Fehlern führen.
**Lösung**: Tools werden über `postCreateCommand` installiert statt über Features.
### Root-Berechtigungen
**Problem**: Der `sail`-Benutzer hat keine Root-Rechte für Paket-Installation.
**Lösung**: Alle notwendigen Tools sind bereits im Docker-Image installiert.
---
**Letzte Aktualisierung**: September 2025
**Laravel Version**: 12.x
**PHP Version**: 8.4.12
**Docker Version**: 2.x
**Status**: ✅ Vollständig funktionsfähig

View file

@ -0,0 +1,88 @@
{
"name": "PR-Copilot (Dev Container)",
// 1. DIES IST DER WICHTIGSTE TEIL:
// Wir verwenden Docker Compose für alle Services
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "laravel.test",
// 3. WIR DEFINIEREN DEN ARBEITSBEREICH:
// Das ist der Pfad, in dem Ihr Code *innerhalb* des Containers liegt.
"workspaceFolder": "/var/www/html",
// 4. WIR LEGEN DEN BENUTZER FEST:
// Laravel Sail führt Befehle standardmäßig als 'sail'-Benutzer aus, um Berechtigungsprobleme zu vermeiden.
"remoteUser": "sail",
// 5. ZUSÄTZLICHE ENTWICKLER-TOOLS (FEATURES):
// Features werden über postCreateCommand installiert um Kompatibilitätsprobleme zu vermeiden
"features": {},
// 6. BEFEHLE NACH DEM ERSTELLEN:
// Installiert nur die Tools die ohne Root-Rechte funktionieren
//"postCreateCommand": "composer install --no-interaction --prefer-dist --optimize-autoloader",
// 7. EDITOR-ANPASSUNGEN (Optional, aber sehr empfohlen):
"customizations": {
"vscode": {
"extensions": [
"bmewburn.vscode-intelephense-client",
"onecentlin.laravel-blade",
"shufo.vscode-blade-formatter",
"bradlc.vscode-tailwindcss"
]
}
},
// 8. ZU STARTENDE DIENSTE:
// Legt fest, welche Dienste aus der docker-compose.yml gestartet werden sollen.
"runServices": [
"laravel.test",
"mysql",
"redis",
"mailpit"
],
// 9. ZUSÄTZLICHE KONFIGURATION:
// Umgebungsvariablen für den DevContainer
"containerEnv": {
"WWWUSER": "501",
"WWWGROUP": "20",
"LARAVEL_SAIL": "1"
},
// 10. MOUNT-KONFIGURATION:
// Stellt sicher, dass der Code korrekt gemountet wird
"mounts": [
"source=${localWorkspaceFolder},target=/var/www/html,type=bind,consistency=cached"
],
// 11. FORWARD PORTS:
// Ports die automatisch weitergeleitet werden sollen
"forwardPorts": [
5177,
5178,
33069,
6382,
1027,
8027
],
"portsAttributes": {
"5177": {
"label": "Vite Dev Server (Portal/Backend)",
"onAutoForward": "notify"
},
"5178": {
"label": "Vite Dev Server (Web)",
"onAutoForward": "notify"
},
"33069": {
"label": "MySQL",
"onAutoForward": "silent"
},
"6382": {
"label": "Redis",
"onAutoForward": "silent"
},
"8027": {
"label": "Mailpit Dashboard",
"onAutoForward": "notify"
},
"1027": {
"label": "Mailpit",
"onAutoForward": "silent"
}
}
}

18
.editorconfig Normal file
View file

@ -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
[docker-compose.yml]
indent_size = 4

65
.env.example Normal file
View file

@ -0,0 +1,65 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
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}"

10
.gitattributes vendored Normal file
View file

@ -0,0 +1,10 @@
* text=auto eol=lf
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
CHANGELOG.md export-ignore
README.md export-ignore

46
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: linter
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
permissions:
contents: write
jobs:
quality:
runs-on: ubuntu-latest
environment: Testing
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
- name: Add Flux Credentials Loaded From ENV
run: composer config http-basic.composer.fluxui.dev "${{ secrets.FLUX_USERNAME }}" "${{ secrets.FLUX_LICENSE_KEY }}"
- name: Install Dependencies
run: |
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
npm install
- name: Run Pint
run: vendor/bin/pint
# - name: Commit Changes
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: fix code style
# commit_options: '--no-verify'
# file_pattern: |
# **/*
# !.github/workflows/*

54
.github/workflows/tests.yml vendored Normal file
View file

@ -0,0 +1,54 @@
name: tests
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
ci:
runs-on: ubuntu-latest
environment: Testing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: xdebug
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install Node Dependencies
run: npm i
- name: Add Flux Credentials Loaded From ENV
run: composer config http-basic.composer.fluxui.dev "${{ secrets.FLUX_USERNAME }}" "${{ secrets.FLUX_LICENSE_KEY }}"
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Copy Environment File
run: cp .env.example .env
- name: Generate Application Key
run: php artisan key:generate
- name: Build Assets
run: npm run build
- name: Run Tests
run: ./vendor/bin/pest

58
.gitignore vendored Normal file
View file

@ -0,0 +1,58 @@
# Laravel
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/public/vendor
/storage/*.key
/storage/app
/storage/framework
/storage/language
/storage/logs
/storage/pail
/vendor
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
# IDEs & Editors
/.fleet
/.idea
/.nova
/.vscode
/.zed
.claude/
.cursor/
# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Icon
# Project specific
_static/
_work/
_storage/

277
ASSET-URLS-GUIDE.md Normal file
View file

@ -0,0 +1,277 @@
# Asset-URLs für Multi-Domain Vite-Setup
## Empfohlene Asset-URLs
Für dein Multi-Domain-Setup empfehle ich folgende Asset-URLs:
### ✅ Aktuelle Konfiguration (EMPFOHLEN)
| Bereich | Domain | Asset-URL | Port | Verwendung |
|---------|--------|-----------|------|------------|
| **Backend** | pr-copilot.test | `assets.pr-copilot.test` | 5177 | Portal + FluxUI |
| **Frontend** | presseecho.test<br>businessportal24.test | `assets-web.pr-copilot.test` | 5178 | Beide Frontend-Domains |
### Warum diese URLs?
#### 1. **assets.pr-copilot.test** (Portal/Backend)
- ✅ Kurz und prägnant
- ✅ Eindeutig dem Portal zugeordnet
- ✅ Keine zusätzliche Subdomain-Tiefe
- ✅ Folgt gängiger Konvention
#### 2. **assets-web.pr-copilot.test** (Web/Frontend)
- ✅ Klar als "Web" (Frontend) gekennzeichnet
- ✅ Ein Asset-Server für beide Frontend-Domains
- ✅ Gute Trennung zu Portal-Assets
- ✅ Einfach zu merken
## Alternative Namenskonventionen
Falls du andere URLs bevorzugst, hier sind Alternativen:
### Option A: Mit Suffix-Präfix
```
portal-assets.pr-copilot.test → Port 5177
web-assets.pr-copilot.test → Port 5178
```
- ⚠️ Etwas länger
- ✅ Sehr explizit
### Option B: Mit "vite" im Namen
```
vite.pr-copilot.test → Port 5177
vite-web.pr-copilot.test → Port 5178
```
- ⚠️ Technologie-spezifisch (was wenn du später zu einem anderen Build-Tool wechselst?)
- ⚠️ Weniger klar was geladen wird
### Option C: Separate Domains pro Frontend
```
assets.pr-copilot.test → Port 5177 (Portal)
assets.presseecho.test → Port 5178 (Presseecho)
assets.businessportal24.test → Port 5178 (Businessportal24)
```
- ⚠️ Mehr DNS-Einträge nötig
- ⚠️ Beide Frontend-Domains würden trotzdem auf denselben Port zeigen
- ❌ Unnötig komplex
### ✅ Empfehlung: Bleib bei der aktuellen Lösung!
## Traefik-Konfiguration (aktuell in docker-compose.yml)
```yaml
# Portal Assets (Backend)
- "traefik.http.routers.assets-portal.rule=Host(`assets.pr-copilot.test`)"
- "traefik.http.routers.assets-portal.entrypoints=websecure"
- "traefik.http.routers.assets-portal.tls=true"
- "traefik.http.routers.assets-portal.service=assets-portal-service"
- "traefik.http.services.assets-portal-service.loadbalancer.server.port=5177"
- "traefik.http.services.assets-portal-service.loadbalancer.server.scheme=http"
# Web Assets (Frontend)
- "traefik.http.routers.assets-web.rule=Host(`assets-web.pr-copilot.test`)"
- "traefik.http.routers.assets-web.entrypoints=websecure"
- "traefik.http.routers.assets-web.tls=true"
- "traefik.http.routers.assets-web.service=assets-web-service"
- "traefik.http.services.assets-web-service.loadbalancer.server.port=5178"
- "traefik.http.services.assets-web-service.loadbalancer.server.scheme=http"
```
## Port-Mapping in docker-compose.yml
```yaml
ports:
- '${VITE_PORT_PORTAL:-5177}:5177'
- '${VITE_PORT_WEB:-5178}:5178'
```
## Umgebungsvariablen (.env)
```env
# Vite Asset Domains
ASSET_URL_PORTAL=https://assets.pr-copilot.test
ASSET_URL_WEB=https://assets-web.pr-copilot.test
# Vite Development Ports
VITE_PORT_PORTAL=5177
VITE_PORT_WEB=5178
```
## DNS / Hosts-Datei
Füge folgende Einträge zu deiner `/etc/hosts` (Linux/Mac) oder `C:\Windows\System32\drivers\etc\hosts` (Windows) hinzu:
```
127.0.0.1 pr-copilot.test
127.0.0.1 presseecho.test
127.0.0.1 businessportal24.test
127.0.0.1 assets.pr-copilot.test
127.0.0.1 assets-web.pr-copilot.test
```
## Vite-Konfigurationen
### vite.portal.config.js
```javascript
export default defineConfig({
// ...
server: {
https: false,
cors: true,
host: "0.0.0.0",
port: 5177,
hmr: {
host: "assets.pr-copilot.test", // ← Asset-URL
protocol: "wss",
},
},
// ...
});
```
### vite.web.config.js
```javascript
export default defineConfig({
// ...
server: {
https: false,
cors: true,
host: "0.0.0.0",
port: 5178,
hmr: {
host: "assets-web.pr-copilot.test", // ← Asset-URL
protocol: "wss",
},
},
// ...
});
```
## Wie funktioniert das Routing?
```
Browser-Request
1. User besucht: https://presseecho.test
2. Laravel lädt View mit: @vite(['resources/css/web/theme-presseecho.css', ...])
3. Vite-Helper generiert: <script src="https://assets-web.pr-copilot.test/@vite/client"></script>
<link href="https://assets-web.pr-copilot.test/resources/css/web/theme-presseecho.css">
4. Browser requested: assets-web.pr-copilot.test
5. Traefik routet zu: Container Port 5178
6. Vite Web Server antwortet
7. HMR WebSocket öffnet: wss://assets-web.pr-copilot.test
8. ✅ Hot Module Replacement funktioniert!
```
## Testing
### 1. DNS-Auflösung testen
```bash
# Sollte zu 127.0.0.1 auflösen
ping assets.pr-copilot.test
ping assets-web.pr-copilot.test
```
### 2. Vite-Server starten
```bash
npm run dev:all
```
Du solltest sehen:
```
[PORTAL] VITE v6.0.x ready in xxx ms
[PORTAL] ➜ Local: http://0.0.0.0:5177/
[PORTAL] ➜ Network: use --host to expose
[WEB] VITE v6.0.x ready in xxx ms
[WEB] ➜ Local: http://0.0.0.0:5178/
```
### 3. Browser-Test
Öffne:
- https://pr-copilot.test (sollte Assets von assets.pr-copilot.test laden)
- https://presseecho.test (sollte Assets von assets-web.pr-copilot.test laden)
- https://businessportal24.test (sollte Assets von assets-web.pr-copilot.test laden)
### 4. HMR-Test
1. Öffne Browser DevTools (F12)
2. Gehe zu "Network" Tab
3. Filter auf "WS" (WebSocket)
4. Du solltest Verbindungen zu `wss://assets.*.pr-copilot.test` sehen
5. Ändere eine CSS-Datei
6. Browser sollte automatisch neu laden (ohne vollständigen Page-Refresh)
## Troubleshooting
### Assets werden nicht geladen
**Problem:** Assets 404 oder laden nicht
**Lösung:**
```bash
# 1. Vite-Server läuft?
npm run dev:all
# 2. Ports erreichbar?
curl http://localhost:5177
curl http://localhost:5178
# 3. Traefik routet korrekt?
docker compose logs laravel.test | grep traefik
```
### HMR funktioniert nicht
**Problem:** Hot Module Replacement lädt nicht automatisch neu
**Lösung:**
1. Browser-Console checken (F12 → Console)
2. WebSocket-Verbindung prüfen (F12 → Network → WS)
3. Falls "WebSocket connection failed":
```bash
# Traefik-Logs checken
docker compose logs laravel.test
# Vite-Server neu starten
npm run dev:all
```
### "Mixed Content"-Fehler
**Problem:** Browser blockiert HTTP-Assets auf HTTPS-Site
**Lösung:**
- Stelle sicher, dass HMR mit `wss://` (nicht `ws://`) läuft
- Prüfe `protocol: "wss"` in Vite-Configs
- Traefik sollte SSL für Asset-Domains bereitstellen
## Zusammenfassung
### ✅ Verwende diese Asset-URLs:
```
assets.pr-copilot.test → Port 5177 (Portal/Backend)
assets-web.pr-copilot.test → Port 5178 (Web/Frontend)
```
### ✅ Vorteile:
- Kurz und prägnant
- Klare Trennung Backend/Frontend
- Ein Asset-Server für beide Frontend-Domains
- Einfach zu merken und zu konfigurieren
- Folgt Best Practices
### ✅ Bereits konfiguriert in:
- ✅ docker-compose.yml (Traefik-Labels + Port-Mapping)
- ✅ vite.portal.config.js (HMR-Host)
- ✅ vite.web.config.js (HMR-Host)
- ✅ .env.example (Variablen-Vorlage)
**Du bist ready to go! 🚀**

155
CLAUDE.md Normal file
View file

@ -0,0 +1,155 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a multi-domain Laravel application called "pr-copilot" that supports different domains with distinct themes and styling. The application uses Laravel with Livewire, Volt, and Fortify for authentication, along with Flux UI components.
### Supported Domains
- **Main Portal**: pr-copilot.test - Main admin portal page
- **Presseecho**: presseecho.test - Landing page with presseecho theme
- **Business Portal**: businessportal24.test - Landing page with business portal theme
## Development Commands
### Installation & Setup
```bash
composer install
npm install
php artisan key:generate
php artisan migrate
php artisan migrate --seed # Run seeders for roles and permissions
```
### Asset Compilation
```bash
npm run dev:portal # Start Portal dev server (Port 5177)
npm run dev:web # Start Web dev server (Port 5178)
npm run dev:all # Start both dev servers concurrently (recommended)
npm run build # Production build (all)
npm run build:portal # Portal-specific assets
npm run build:web # Web-specific assets
```
### Development Server
```bash
php artisan serve # Start Laravel development server
composer run dev # Start full development stack (server, queue, logs, vite)
```
### Testing
```bash
composer run test # Run Pest tests (clears config first)
php artisan test # Direct Laravel test command
php artisan test --filter TestName # Run specific test
```
### Domain Management
```bash
php artisan domains:generate-favicons # Generate placeholder favicons for all domains
```
## Architecture
### Domain-Based Theme System
The application uses a sophisticated domain-based theme system that determines styling and assets at runtime:
**How it works:**
1. `ThemeServiceProvider` detects the incoming domain from the HTTP request
2. Looks up domain config in `/config/domains.php` by matching `domain_name`
3. Sets theme variables globally via `View::share()` and `config()`
4. Vite automatically loads the correct build directory based on `assets_dir`
**Key configuration** (`/config/domains.php`):
- Each domain has: `domain_name`, `url`, `theme`, `view_prefix`, `assets_dir`, `color_scheme`, `font`
- Portal domain uses `build/portal` assets
- Web domains (presseecho, businessportal24) share `build/web` assets but load different CSS theme files
**Development features:**
- Simulate any domain locally: Set `DEV_SIMULATE_DOMAIN=true` and `DEV_SIMULATED_DOMAIN=presseecho.test` in `.env`
- Theme override via URL: Add `?theme=presseecho` to test different themes
### Key Components
- **Livewire Components**: Located in `app/Livewire/` with the following structure:
- `app/Livewire/Actions/` - Reusable actions (e.g., Logout)
- Auth components in `resources/views/livewire/auth/` (login, register, password reset, etc.)
- Settings components in `resources/views/livewire/settings/` (profile, password, appearance)
- Admin components in `resources/views/livewire/admin/` (users management)
- Web components in `resources/views/livewire/web/` (frontend features)
- **Volt Components**: Single-file Livewire components using functional API for rapid development
- **Flux UI**: Premium UI component library for consistent design (Portal only)
- **Multi-Build System**: Separate Vite configurations for different asset bundles
### Authentication & Authorization
- **Laravel Fortify**: Handles authentication features
- **Laravel Sanctum**: API token authentication
- **Spatie Permissions**: Role and permission management system
### Asset Management
The project uses a **dual-port Vite setup** with separate configurations:
- **Portal (Backend)**: `vite.portal.config.js` - Port 5177, includes FluxUI
- **Web (Frontend)**: `vite.web.config.js` - Port 5178, no FluxUI
- **Tailwind Configs**: `tailwind.portal.config.js` and `tailwind.web.config.js`
**Why two ports?** Vite can only run one configuration at a time. The portal uses FluxUI components while web domains don't, requiring separate builds. Web domains (presseecho & businessportal24) share the same Vite server and differ only in CSS variables loaded at runtime via `ThemeServiceProvider`.
**Build directories**:
- Portal assets → `public/build/portal/`
- Web assets → `public/build/web/`
### Database
- **SQLite** for development (`database/database.sqlite`)
- **Migrations**: Users (with 2FA columns), cache, jobs, personal access tokens
- **Seeders**: `RolesAndPermissionsSeeder` - Run with `php artisan migrate --seed`
### Testing Framework
- **Pest PHP** (v3.8+) - Modern testing framework built on PHPUnit
- Configuration: `phpunit.xml` and `tests/Pest.php`
- Test database: Uses `DB_DATABASE=testing` environment (configured in phpunit.xml)
- Test directories: `tests/Feature/` (authentication, dashboard, settings) and `tests/Unit/`
## Important Files & Configuration
- **Domain System**:
- `/config/domains.php` - Domain and theme configuration
- `/app/Providers/ThemeServiceProvider.php` - Core theme switching logic at runtime
- `/routes/domains.php` - Domain-specific routing
- **Routes**:
- `/routes/web.php` - Public web routes
- `/routes/auth.php` - Authentication routes
- `/routes/admin.php` - Admin portal routes
- `/routes/api.php` - API endpoints with Sanctum protection
- **Views Structure**:
- `resources/views/web/` - Frontend domain views (presseecho, businessportal24)
- `resources/views/admin/` - Backend portal views
- `resources/views/components/` - Shared components across all domains
- `resources/views/components/layouts/` - Layout components (app, auth)
- `resources/views/livewire/` - Livewire components (auth, settings, admin, web)
- **Vite & Assets**:
- `vite.portal.config.js` - Backend/Portal build configuration (Port 5177)
- `vite.web.config.js` - Frontend/Web build configuration (Port 5178)
- `tailwind.portal.config.js` and `tailwind.web.config.js` - Separate Tailwind configs
- `resources/css/portal.css` - Portal styles with FluxUI
- `resources/css/web/theme-*.css` - Theme-specific CSS for web domains
- **Documentation**:
- `DOMAINS-CONFIG.md` - Detailed domain setup instructions
- `FORTIFY-SANCTUM-SETUP.md` - Authentication setup guide
- `VITE-SETUP.md` - Dual-port Vite architecture explanation

114
DOMAINS-CONFIG.md Normal file
View file

@ -0,0 +1,114 @@
# Multi-Domain-Konfiguration für Laravel
Dieses Projekt unterstützt mehrere Domains mit unterschiedlichen Styles und Konfigurationen.
Die Domains werden über `.env`-Variablen konfiguriert.
## Basis-Konfiguration
Füge die folgenden Variablen zu deiner `.env`-Datei hinzu:
```env
# Domain-Konfigurationen
APP_NAME=pr-copilot
APP_URL=https://pr-copilot.test
APP_PRIMARY="#3ea3dc"
APP_ACCENT="#5c5c60"
# Entwicklungseinstellungen für Domains
DEV_SIMULATE_DOMAIN=false
DEV_SIMULATED_DOMAIN=pr-copilot.test
```
## Entwicklungsmodus
Während der Entwicklung kann es nützlich sein, verschiedene Domains zu simulieren,
ohne die Host-Datei bearbeiten zu müssen:
1. Setze `DEV_SIMULATE_DOMAIN=true` in deiner `.env`-Datei.
2. Setze `DEV_SIMULATED_DOMAIN` auf eine der konfigurierten Domains (z.B. `landing1.local`).
Dies bewirkt, dass die Anwendung so reagiert, als würde sie unter der angegebenen Domain laufen,
unabhängig von der tatsächlichen URL.
## Domain-spezifische Konfiguration
Jede Domain kann eigene Einstellungen haben:
### Haupt-Website (pr-copilot.test)
- `APP_URL`: Die Domain für die Haupt-Website (https://pr-copilot.test)
- `APP_NAME`: Der Name der Haupt-Website (pr-copilot)
- `APP_PRIMARY`: Die primäre Farbe im HEX-Format (#3ea3dc)
- `APP_ACCENT`: Die Akzentfarbe im HEX-Format (#5c5c60)
### Presseecho (presseecho.test)
- `APP_PRESSEECHO`: Die Domain für Presseecho (presseecho.test)
- `APP_PRESSEECHO_URL`: Die vollständige URL (https://presseecho.test)
- `APP_PRESSEECHO_NAME`: Der Name der Website (presseecho)
- `APP_PRESSEECHO_PRIMARY`: Die primäre Farbe im HEX-Format (#e94a3c)
- `APP_PRESSEECHO_ACCENT`: Die Akzentfarbe im HEX-Format (#5c5c60)
### Business Portal (businessportal24.test)
- `APP_BUSINESSPORTAL`: Die Domain für das Business Portal (businessportal24.test)
- `APP_BUSINESSPORTAL_URL`: Die vollständige URL (https://businessportal24.test)
- `APP_BUSINESSPORTAL_NAME`: Der Name der Website (businessportal24)
- `APP_BUSINESSPORTAL_PRIMARY`: Die primäre Farbe im HEX-Format (#f69f0f)
- `APP_BUSINESSPORTAL_ACCENT`: Die Akzentfarbe im HEX-Format (#5c5c60)
## Hosts-Datei konfigurieren
Um die verschiedenen Domains lokal zu testen, füge folgende Zeilen zu deiner Hosts-Datei hinzu:
```
127.0.0.1 pr-copilot.test
127.0.0.1 presseecho.test
127.0.0.1 businessportal24.test
```
Die Hosts-Datei befindet sich unter:
- Windows: `C:\Windows\System32\drivers\etc\hosts`
- macOS/Linux: `/etc/hosts`
## Verwendung im Code
Im Code kannst du auf die Domain-Konfiguration zugreifen:
```php
// Domain-Name in einem View
{{ $domainName }}
// Theme in einem View
{{ $theme }}
// Vollständige Domain-Konfiguration
{{ $domainConfig['description'] }}
// Über die app-Config
{{ config('app.theme') }}
{{ config('app.domain_name') }}
// Aktuelle Domain ermitteln
{{ request()->getHost() }}
// Domain-spezifische Assets laden
@vite(['resources/css/web/theme-main.css'])
```
## Aktuelle Implementierung
Das Projekt verwendet bereits eine Multi-Domain-Architektur mit:
- **Hauptwebsite:** `pr-copilot.test` - Hauptwebsite mit blauem Theme (#3ea3dc)
- **Presseecho:** `presseecho.test` - Presseecho-Website mit rotem Theme (#e94a3c)
- **Business Portal:** `businessportal24.test` - Business Portal mit orangem Theme (#f69f0f)
Jede Domain kann eigene Farben, Namen und Konfigurationen haben und lädt automatisch domainspezifische Assets über Vite.
## Verfügbare Routen
- **Web:** `/`, `/welcome`
- **Auth:** `/login`, `/register`, `/forgot-password`
- **Admin:** `/dashboard`, `/admin/users`, `/settings/*` (falls implementiert)

103
FINAL-FIX-SUMMARY.md Normal file
View file

@ -0,0 +1,103 @@
# ✅ Finale Fehlerbehebung - Asset-URL Probleme gelöst
## 🔍 Ursprüngliches Problem
Auf https://pr-copilot.test erschien der Fehler:
```
[Error] Not allowed to use restricted network host "0.0.0.0":
https://0.0.0.0:5178/@vite/client
```
## 🎯 Ursache
1. **Falscher Build-Ordner**: `routes/domains.php` verwendete `build/admin` statt `build/portal`
2. **Falscher Port**: Portal versuchte Port 5178 (Web) statt 5177 (Portal) zu verwenden
3. **Fehlende CSS-Datei**: `portal.css` existierte nicht, `vite.portal.config.js` referenzierte sie aber
## ✅ Durchgeführte Fixes
### 1. Build-Ordner korrigiert
**Datei**: `routes/domains.php`
```php
// VORHER (❌ FALSCH):
Vite::useBuildDirectory('build/admin');
// NACHHER (✅ RICHTIG):
Vite::useBuildDirectory('build/portal');
```
### 2. CSS-Datei umbenannt
```bash
resources/css/app.css → resources/css/portal.css
```
### 3. Alle Views aktualisiert
Geänderte Dateien:
- `resources/views/partials/head.blade.php`
- `resources/views/partials/admin-head.blade.php`
- `resources/views/layouts/admin-master.blade.php`
- `resources/views/web/layouts/admin-master.blade.php`
Alle verwenden jetzt:
```php
@vite(['resources/css/portal.css', 'resources/js/app.js'])
```
### 4. Vite-Server neu gestartet
```bash
pkill -f "vite --config"
npm run dev:all
```
## 🧪 Verifikation
```bash
# Portal CSS wird korrekt geladen:
curl -Iks https://assets.pr-copilot.test/resources/css/portal.css
# → HTTP/2 200 ✅
# Web Assets funktionieren:
curl -Iks https://assets.presseecho.test/resources/css/web/theme-presseecho.css
curl -Iks https://assets.businessportal24.test/resources/css/web/theme-businessportal24.css
```
## 📋 Finale Struktur
| Domain | Asset-Domain | Port | Build-Dir | CSS-Datei |
|--------|-------------|------|-----------|-----------|
| pr-copilot.test | assets.pr-copilot.test | 5177 | build/portal | portal.css |
| presseecho.test | assets.presseecho.test | 5178 | build/web | theme-presseecho.css |
| businessportal24.test | assets.businessportal24.test | 5178 | build/web | theme-businessportal24.css |
## 🚀 Nächste Schritte
1. **Browser testen**: Öffne https://pr-copilot.test und mache einen Hard-Refresh (`Ctrl+Shift+R`)
2. **Keine Fehler mehr**: Die "0.0.0.0" Fehler sollten verschwunden sein
3. **Assets laden über HTTPS**: Alle CSS/JS-Dateien werden über die korrekten Asset-Subdomains geladen
## 📝 Wichtige Hinweise
- **Vite-Server laufen im Hintergrund**: Logs unter `/tmp/vite-server.log`
- **Bei Änderungen**: Vite HMR (Hot Module Replacement) funktioniert jetzt korrekt
- **Produktion**: Für Production einfach `npm run build` ausführen
## ⚠️ Falls Docker Container neu gestartet wurden
Falls du die Docker Container neu gestartet hast, stelle sicher dass:
1. ✅ DNS-Einträge in `/etc/hosts` vorhanden sind:
```
127.0.0.1 assets.pr-copilot.test
127.0.0.1 assets.presseecho.test
127.0.0.1 assets.businessportal24.test
```
2. ✅ Vite-Server laufen:
```bash
npm run dev:all > /tmp/vite-server.log 2>&1 &
```
## 🎉 Ergebnis
Alle drei Domains laden jetzt ihre Assets korrekt über HTTPS von ihren jeweiligen Asset-Subdomains!

107
FINALE-ASSET-URL-FIXES.md Normal file
View file

@ -0,0 +1,107 @@
# ✅ Finale Asset-URL Fixes - Zusammenfassung
## 🔧 Was wurde geändert
### 1. `config/domains.php`
Jede Domain hat jetzt eine dedizierte `asset_url`:
- `portal`: `https://assets.pr-copilot.test`
- `presseecho`: `https://assets.presseecho.test`
- `businessportal24`: `https://assets.businessportal24.test`
### 2. `app/Providers/ThemeServiceProvider.php`
- Setzt `config('app.asset_url')` dynamisch basierend auf der Domain
- Aktualisiert die `public/hot` Datei mit der richtigen Asset-URL
- Vite verwendet nun die domain-spezifische Asset-URL
### 3. `vite.web.config.js`
- Hinzugefügt: `allowedHosts` für alle Asset-Domains
- Erlaubt Anfragen von beiden Web-Asset-Domains
### 4. `config/vite.php` (NEU)
- Neue Laravel Vite-Konfiguration
- Verwendet die dynamische `ASSET_URL` aus der Umgebung
## 🚀 Jetzt testen
### 1. Vite-Server neu starten
```bash
# Stoppe alle Vite-Server
pkill -f "vite --config"
# Starte neu
npm run dev:all > /tmp/vite-server.log 2>&1 &
# Prüfe Status
sleep 5 && tail -30 /tmp/vite-server.log
```
### 2. Im Browser testen
Öffne mit Hard-Refresh (`Ctrl+Shift+R`):
- ✅ https://pr-copilot.test
- ✅ https://presseecho.test
- ✅ https://businessportal24.test
### 3. Erwartetes Verhalten
**VORHER (❌)**:
```
https://0.0.0.0:5178/@vite/client
```
**NACHHER (✅)**:
```
https://assets.pr-copilot.test/@vite/client
https://assets.presseecho.test/@vite/client
https://assets.businessportal24.test/@vite/client
```
## 🔍 Debug-Befehle
Falls Probleme auftreten:
```bash
# 1. Prüfe Hot-File
cat public/hot
# 2. Prüfe Asset-Domains
curl -Ik https://assets.presseecho.test/@vite/client
curl -Ik https://assets.businessportal24.test/@vite/client
# 3. Prüfe Vite-Server Logs
tail -50 /tmp/vite-server.log
# 4. Cache leeren
php artisan config:clear && php artisan view:clear
```
## 📋 Wie es funktioniert
1. **Request kommt an** → z.B. `businessportal24.test`
2. **ThemeServiceProvider** erkennt die Domain
3. **Config wird geladen**`config/domains.php` für `businessportal24`
4. **Asset-URL wird gesetzt**`https://assets.businessportal24.test`
5. **Hot-File wird aktualisiert**`public/hot` bekommt die richtige URL
6. **Vite lädt Assets** → Von der richtigen Asset-Domain (Port 5178)
7. **Traefik leitet weiter** → Von Port 443 (HTTPS) zu Port 5178 (intern)
## ✨ Vorteile der neuen Lösung
✅ Saubere Trennung pro Domain
✅ Keine Port-Nummern in URLs
✅ HTTPS funktioniert korrekt
✅ Dynamische Asset-URLs basierend auf Domain
✅ Funktioniert mit Vite HMR (Hot Module Replacement)
✅ Erweiterbar für neue Domains
## 🎯 Nächste Schritte
Wenn alles funktioniert:
1. Dokumentiere die neue Struktur im Team
2. Lösche alte/temporäre Dokumentationsdateien
3. Commit die Änderungen
Viel Erfolg! 🚀

185
FORTIFY-SANCTUM-SETUP.md Normal file
View file

@ -0,0 +1,185 @@
# Laravel Fortify & Sanctum Setup
## Übersicht
Dieses Projekt wurde mit Laravel Fortify für die Authentifizierung und Laravel Sanctum für API-Token-Management konfiguriert. Die Authentifizierung verwendet Livewire-Komponenten mit Flux UI für eine moderne, reaktive Benutzeroberfläche.
## Installation
Die Pakete wurden bereits installiert und konfiguriert:
```bash
composer require laravel/fortify laravel/sanctum
```
## Konfiguration
### Fortify
- **Konfigurationsdatei**: `config/fortify.php`
- **Service Provider**: `app/Providers/FortifyServiceProvider.php`
- **Aktionen**: `app/Actions/Fortify/`
- **Livewire-Komponenten**: `resources/views/livewire/auth/`
### Sanctum
- **Konfigurationsdatei**: `config/sanctum.php`
- **Migrationen**: Ausgeführt
- **User Model**: Aktualisiert mit `HasApiTokens` Trait
## Features
### Fortify Features (aktiviert)
- ✅ Benutzerregistrierung (Livewire + Flux UI)
- ✅ Passwort-Reset (Livewire + Flux UI)
- ✅ Profilaktualisierung
- ✅ Passwort-Update
- ✅ Zwei-Faktor-Authentifizierung
- ⚠️ E-Mail-Verifizierung (deaktiviert in der Konfiguration)
### Sanctum Features
- ✅ API-Token-Erstellung
- ✅ Token-Revocation
- ✅ Geschützte API-Routen
## Technologie-Stack
- **Laravel Fortify**: Backend-Authentifizierung
- **Laravel Sanctum**: API-Token-Management
- **Livewire**: Reaktive Frontend-Komponenten
- **Flux UI**: Moderne UI-Komponenten
- **Volt**: Livewire-Komponenten-Syntax
## Routen
### Web-Authentifizierung (pr-copilot.test)
- `GET /login` - Anmeldeseite (Livewire)
- `POST /login` - Anmeldung (Livewire)
- `POST /logout` - Abmeldung
- `GET /register` - Registrierungsseite (Livewire)
- `POST /register` - Registrierung (Livewire)
- `GET /forgot-password` - Passwort vergessen (Livewire)
- `POST /forgot-password` - Passwort-Reset-Link senden (Livewire)
- `GET /reset-password/{token}` - Passwort zurücksetzen (Livewire)
- `POST /reset-password` - Neues Passwort setzen (Livewire)
- `GET /verify-email` - E-Mail-Verifizierung (Livewire)
- `GET /confirm-password` - Passwort bestätigen (Livewire)
### API-Routen (api.pr-copilot.test)
- `GET /api/user` - Aktueller Benutzer (geschützt)
- `GET /api/profile` - Benutzerprofil (geschützt)
- `POST /api/login` - API-Anmeldung (öffentlich)
## Verwendung
### Web-Authentifizierung
1. Besuchen Sie `http://portal.pr-copilot.test/login`
2. Registrieren Sie sich oder melden Sie sich an
3. Nutzen Sie die verschiedenen Authentifizierungsfeatures
### API-Authentifizierung
1. **Token erstellen**:
```bash
curl -X POST http://api.pr-copilot.test/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"password"}'
```
2. **Geschützte Route aufrufen**:
```bash
curl -X GET http://api.pr-copilot.test/api/user \
-H "Authorization: Bearer YOUR_TOKEN_HERE"
```
### Zwei-Faktor-Authentifizierung
1. Aktivieren Sie 2FA in Ihren Benutzereinstellungen
2. Scannen Sie den QR-Code mit Ihrer Authentifizierungs-App
3. Geben Sie den Code bei der Anmeldung ein
## Livewire-Komponenten
Alle Auth-Komponenten befinden sich in `resources/views/livewire/auth/`:
- `login.blade.php` - Anmeldeseite mit Flux UI
- `register.blade.php` - Registrierungsseite mit Flux UI
- `forgot-password.blade.php` - Passwort vergessen mit Flux UI
- `reset-password.blade.php` - Passwort zurücksetzen mit Flux UI
- `verify-email.blade.php` - E-Mail-Verifizierung mit Flux UI
- `confirm-password.blade.php` - Passwort bestätigen mit Flux UI
### Flux UI Features
- Moderne, responsive Benutzeroberfläche
- Eingabevalidierung in Echtzeit
- Rate Limiting mit visuellen Feedback
- Dark Mode Unterstützung
- Barrierefreiheit
## Anpassungen
### Fortify-Konfiguration anpassen
Bearbeiten Sie `config/fortify.php` um Features zu aktivieren/deaktivieren:
```php
'features' => [
Features::registration(),
Features::resetPasswords(),
Features::emailVerification(), // Aktivieren für E-Mail-Verifizierung
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirm' => true,
'confirmPassword' => true,
]),
],
```
### Livewire-Komponenten anpassen
Bearbeiten Sie die Komponenten in `resources/views/livewire/auth/`:
```php
// Beispiel: Login-Komponente anpassen
new #[Layout('components.layouts.auth')] class extends Component {
#[Validate('required|string|email')]
public string $email = '';
// Ihre Anpassungen hier...
}
```
### Sanctum-Konfiguration anpassen
Bearbeiten Sie `config/sanctum.php` um Token-Einstellungen zu ändern:
```php
'expiration' => null, // Token-Ablaufzeit (null = nie)
'guard' => ['web'], // Guards für Sanctum
```
## Sicherheit
- Alle Passwörter werden automatisch gehashed
- CSRF-Schutz ist aktiviert
- Rate Limiting ist konfiguriert
- Zwei-Faktor-Authentifizierung ist verfügbar
- API-Tokens können widerrufen werden
- Livewire-Komponenten haben eingebaute Sicherheitsfeatures
## Nächste Schritte
1. Konfigurieren Sie E-Mail-Einstellungen in `.env` für Passwort-Reset
2. Aktivieren Sie E-Mail-Verifizierung falls gewünscht
3. Passen Sie die Livewire-Komponenten an Ihr Design an
4. Erstellen Sie zusätzliche API-Routen nach Bedarf
5. Konfigurieren Sie Flux UI Themes nach Ihren Wünschen

63
Readme.md Normal file
View file

@ -0,0 +1,63 @@
# Multi-Domain Laravel-Anwendung
## Übersicht
Diese Laravel-Anwendung unterstützt verschiedene Domains mit unterschiedlichen Styles:
- **Haupt-Website**: =https://pr-copilot.test - Haupt-Protal Admin-Page
- **APP_PRESSEECHO**: https://presseecho.test
- **APP_BUSINESSPORTAL**: https://businessportal24.test
## Installation
1. Repository klonen
2. Abhängigkeiten installieren:
```bash
composer install
npm install
```
3. Umgebungsvariablen konfigurieren (siehe `.env.example` und `DOMAINS-CONFIG.md`)
4. Laravel-Anwendung initialisieren:
```bash
php artisan key:generate
php artisan migrate
```
5. Assets kompilieren:
```bash
npm run build
npm run build:admin
npm run build:web
```
## Domain-Konfiguration
Die Domains werden über die `.env`-Datei konfiguriert. Für detaillierte Anweisungen siehe `DOMAINS-CONFIG.md`.
### Lokaler Entwicklungsserver
```bash
php artisan serve
```
## Asset-Kompilierung
Diese Anwendung verwendet Vite mit verschiedenen Konfigurationen:
- **Hauptkompilierung**: `npm run dev` oder `npm run build`
- **Admin-Assets**: `npm run build:admin`
- **Web-Assets**: `npm run build:web`
## Domain-Simulation
Während der Entwicklung können Domains simuliert werden, ohne die Hosts-Datei zu bearbeiten:
1. In der `.env`-Datei: `DEV_SIMULATE_DOMAIN=true`
2. Gewünschte Domain angeben: `DEV_SIMULATED_DOMAIN=landing1.local`
## Favicons
Um Platzhalter-Favicons für alle konfigurierten Domains zu generieren:
```bash
php artisan domains:generate-favicons
```

309
THEME-INTEGRATION.md Normal file
View file

@ -0,0 +1,309 @@
# Theme-Integration Anleitung
## Überblick
Das Projekt nutzt ein dynamisches Theme-System mit 3 Domains:
| Domain | Theme | Primary Color | Secondary Color | CSS-Datei |
|--------|-------|---------------|-----------------|-----------|
| **pr-copilot.test** | portal | #526266 | #82a0a7 | `resources/css/portal.css` |
| **presseecho.test** | presseecho | #345636 (Grün) | #6b8f71 | `resources/css/web/theme-presseecho.css` |
| **businessportal24.test** | businessportal24 | #cf3628 (Rot) | #f0834a | `resources/css/web/theme-businessportal24.css` |
## CSS-Dateien in Blade-Templates laden
### Backend (Portal)
Im Portal-Layout (`resources/views/layouts/portal/app.blade.php`):
```blade
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ config('app.name') }}</title>
{{-- Portal CSS mit FluxUI --}}
@vite(['resources/css/portal.css', 'resources/js/app.js'])
</head>
<body>
@yield('content')
</body>
</html>
```
### Frontend (Web) - Dynamisch
Im Web-Layout (`resources/views/layouts/web/app.blade.php`):
```blade
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ $domainConfig['description'] ?? config('app.name') }}</title>
{{-- Dynamisches Theme-Loading basierend auf Domain --}}
@if($theme === 'presseecho')
@vite(['resources/css/web/theme-presseecho.css', 'resources/js/app.js'])
@elseif($theme === 'businessportal24')
@vite(['resources/css/web/theme-businessportal24.css', 'resources/js/app.js'])
@else
{{-- Fallback --}}
@vite(['resources/css/web/shared-styles.css', 'resources/js/app.js'])
@endif
</head>
<body>
@yield('content')
</body>
</html>
```
### Alternative: Helper-basiert
Sie können auch den ThemeHelper verwenden:
```blade
@php
$themeCss = match($theme) {
'presseecho' => 'resources/css/web/theme-presseecho.css',
'businessportal24' => 'resources/css/web/theme-businessportal24.css',
default => 'resources/css/web/shared-styles.css',
};
@endphp
@vite([$themeCss, 'resources/js/app.js'])
```
## Verfügbare Theme-Variablen in Views
Der `ThemeServiceProvider` macht folgende Variablen in allen Views verfügbar:
```php
$theme // z.B. 'portal', 'presseecho', 'businessportal24'
$viewPrefix // z.B. 'portal', 'web'
$domainName // z.B. 'presseecho.test'
$domainUrl // z.B. 'https://presseecho.test'
$domainConfig // Array mit kompletter Domain-Konfiguration
```
### Beispiel-Nutzung in Blade
```blade
{{-- Domain-Name anzeigen --}}
<h1>Willkommen auf {{ $domainName }}</h1>
{{-- Theme-spezifische Farben --}}
<div style="color: {{ $domainConfig['color_scheme']['primary'] }}">
Primary Color Text
</div>
{{-- Font-Familie --}}
<p style="font-family: {{ $domainConfig['font'] }}">
Custom Font Text
</p>
{{-- Conditional Content basierend auf Theme --}}
@if($theme === 'presseecho')
<p>Presseecho-spezifischer Content</p>
@elseif($theme === 'businessportal24')
<p>Businessportal24-spezifischer Content</p>
@else
<p>Portal Content</p>
@endif
```
## CSS-Variablen nutzen
Alle Themes verwenden CSS-Variablen für konsistentes Styling:
```blade
{{-- Tailwind Classes mit Theme-Variablen --}}
<button class="bg-primary text-white hover:bg-secondary">
Klicken
</button>
<div class="border border-border bg-card text-card-foreground rounded-lg p-4">
Card Content
</div>
{{-- Primary & Secondary Buttons --}}
<button class="btn btn-primary">Primary Action</button>
<button class="btn btn-secondary">Secondary Action</button>
```
## CSS-Variablen-Referenz
Alle Themes definieren folgende CSS-Variablen:
```css
/* Layout */
--background /* Hintergrundfarbe */
--foreground /* Textfarbe */
/* Cards */
--card /* Card-Hintergrund */
--card-foreground /* Card-Text */
/* Popover */
--popover /* Popover-Hintergrund */
--popover-foreground /* Popover-Text */
/* Brand Colors */
--primary /* Primärfarbe */
--secondary /* Sekundärfarbe */
/* UI States */
--muted /* Gedämpfte Farbe */
--muted-foreground /* Gedämpfter Text */
--accent /* Akzentfarbe */
--accent-foreground /* Akzent-Text */
--destructive /* Fehler/Löschen */
--destructive-foreground /* Fehler-Text */
/* Form Elements */
--border /* Border-Farbe */
--input /* Input-Hintergrund */
--ring /* Focus-Ring */
/* Border Radius */
--radius /* Standard Border-Radius */
/* Typography */
--font-primary /* Haupt-Schriftart */
--font-secondary /* Sekundär-Schriftart */
```
## Tailwind-Klassen mit Theme-Variablen
```blade
{{-- Background Colors --}}
<div class="bg-background text-foreground">...</div>
<div class="bg-card text-card-foreground">...</div>
<div class="bg-primary text-white">...</div>
<div class="bg-secondary text-white">...</div>
{{-- Text Colors --}}
<p class="text-foreground">...</p>
<p class="text-muted-foreground">...</p>
<p class="text-primary">...</p>
<p class="text-secondary">...</p>
{{-- Borders --}}
<div class="border border-border">...</div>
<input class="border-input">
{{-- Border Radius --}}
<div class="rounded-lg">...</div> {{-- nutzt --radius --}}
<div class="rounded-md">...</div>
<div class="rounded-sm">...</div>
```
## Dark Mode
Alle Themes unterstützen Dark Mode durch die `.dark`-Klasse:
```blade
{{-- Dark Mode Toggle --}}
<html class="dark">
{{-- Alle CSS-Variablen werden automatisch angepasst --}}
</html>
{{-- JavaScript Toggle --}}
<button onclick="document.documentElement.classList.toggle('dark')">
Toggle Dark Mode
</button>
```
## ThemeHelper verwenden
Der `ThemeHelper` bietet praktische Methoden:
```blade
{{-- Logo abrufen --}}
<img src="{{ asset(App\Helpers\ThemeHelper::getLogoPath('positive')) }}" alt="Logo">
<img src="{{ asset(App\Helpers\ThemeHelper::getLogoPath('negative')) }}" alt="Logo Dark">
{{-- Favicon --}}
<link rel="icon" href="{{ asset(App\Helpers\ThemeHelper::getFaviconPath()) }}">
{{-- Primary/Secondary Colors (für inline styles) --}}
<div style="background: {{ App\Helpers\ThemeHelper::getPrimaryColor() }}">...</div>
{{-- Font-Familie --}}
<style>
body {
font-family: {{ App\Helpers\ThemeHelper::getFont() }};
}
</style>
{{-- Domain Config --}}
@php
$config = App\Helpers\ThemeHelper::getDomainConfig();
@endphp
```
## Vite Dev Server starten
```bash
# Beide Server gleichzeitig
npm run dev:all
# Nur Backend (Portal)
npm run dev:portal
# Nur Frontend (Web)
npm run dev:web
```
## Production Build
```bash
# Alle Builds
npm run build
# Einzelne Builds
npm run build:portal
npm run build:web
```
## Testing verschiedener Themes
### Via URL-Parameter (für Development)
Der `ThemeServiceProvider` unterstützt einen `?theme=` URL-Parameter zum Testen:
```
https://pr-copilot.test?theme=presseecho
https://pr-copilot.test?theme=businessportal24
```
### Via Host
Einfach die entsprechende Domain aufrufen:
```
https://pr-copilot.test → Portal Theme
https://presseecho.test → Presseecho Theme
https://businessportal24.test → Businessportal24 Theme
```
## Troubleshooting
### Styles werden nicht geladen
1. Prüfe ob der richtige Vite-Server läuft (`npm run dev:all`)
2. Prüfe ob die richtige CSS-Datei im Blade-Template geladen wird
3. Cache leeren: `php artisan config:clear && php artisan view:clear`
### Falsche Farben
1. Prüfe `config/domains.php` für Domain-Konfiguration
2. Prüfe die CSS-Variablen in der Theme-Datei
3. Browser-Cache leeren (Strg+Shift+R)
### Theme wechselt nicht
1. Prüfe `ThemeServiceProvider` ob Domain erkannt wird
2. Prüfe `.env` für Domain-Konfiguration
3. `php artisan config:clear` ausführen

View file

@ -0,0 +1,90 @@
# Neue Vite Asset-URL Struktur
## ✅ Neue saubere Trennung
Jede Domain hat jetzt ihre eigene dedizierte Asset-Subdomain:
| Domain | Asset-Subdomain | Port | Vite-Config |
|--------|----------------|------|-------------|
| `pr-copilot.test` | `assets.pr-copilot.test` | 5177 | `vite.portal.config.js` |
| `presseecho.test` | `assets.presseecho.test` | 5178 | `vite.web.config.js` |
| `businessportal24.test` | `assets.businessportal24.test` | 5178 | `vite.web.config.js` |
## 📋 Notwendige Schritte
### 1. DNS / Hosts-Datei aktualisieren
Füge folgende Einträge zu deiner Hosts-Datei hinzu (lokal auf deinem Host-System, NICHT im Container):
**macOS/Linux**: `/etc/hosts`
**Windows**: `C:\Windows\System32\drivers\etc\hosts`
```
127.0.0.1 assets.pr-copilot.test
127.0.0.1 assets.presseecho.test
127.0.0.1 assets.businessportal24.test
```
### 2. Docker Container neu starten
Die Traefik-Konfiguration wurde aktualisiert. Starte die Container neu:
```bash
# Auf dem Host-System (außerhalb des Containers):
docker compose restart
```
### 3. Vite-Server starten
Im DevContainer:
```bash
cd /var/www/html
npm run dev:all
```
## 🔧 Was wurde geändert?
### 1. `docker-compose.yml`
Neue Traefik-Routen hinzugefügt:
- `assets.pr-copilot.test` → Port 5177 (Portal)
- `assets.presseecho.test` → Port 5178 (Presseecho)
- `assets.businessportal24.test` → Port 5178 (Businessportal24)
### 2. `app/Helpers/ThemeHelper.php`
Neue Methode `getAssetUrl()` die die richtige Asset-URL basierend auf dem Theme zurückgibt.
### 3. `app/Providers/AppServiceProvider.php`
Setzt die Asset-URL dynamisch basierend auf der aktuellen Domain.
### 4. `vite.web.config.js`
HMR-Konfiguration vorbereitet für dynamische Host-Zuweisung.
## 🧪 Testen
Nach dem Neustart kannst du testen:
```bash
# Im DevContainer:
curl -Ik https://assets.pr-copilot.test/@vite/client
curl -Ik https://assets.presseecho.test/@vite/client
curl -Ik https://assets.businessportal24.test/@vite/client
```
Alle sollten einen 200 OK Status zurückgeben (nachdem die Vite-Server laufen).
## 🎯 Vorteile der neuen Struktur
✅ Saubere Trennung pro Domain
✅ Keine Konflikte zwischen Portal und Web
✅ Einfacher zu debuggen
✅ Klare URL-Struktur
✅ Flexibel erweiterbar für neue Domains
## ⚠️ Wichtig
Die Vite-Server müssen laufen, damit die Assets geladen werden können:
- **Entwicklung**: `npm run dev:all`
- **Produktion**: Assets werden aus `public/build/*` geladen (kein Vite-Server nötig)

145
VITE-SETUP.md Normal file
View file

@ -0,0 +1,145 @@
# Vite Multi-Domain Setup
## Übersicht
Dieses Projekt verwendet **2 separate Vite-Ports** für unterschiedliche Domain-Bereiche:
| Bereich | Port | Vite Config | Tailwind Config | Domains | FluxUI |
|---------|------|-------------|-----------------|---------|--------|
| **Backend (Portal)** | 5177 | `vite.portal.config.js` | `tailwind.portal.config.js` | `pr-copilot.test` | ✅ Ja |
| **Frontend (Web)** | 5178 | `vite.web.config.js` | `tailwind.web.config.js` | `presseecho.test`, `businessportal24.test` | ❌ Nein |
## Warum 2 Ports?
### Ein Port reicht NICHT aus, weil:
- Vite kann nur **eine Konfiguration gleichzeitig** ausführen
- Backend nutzt **FluxUI** (flux-pro/flux), Frontend nicht
- Unterschiedliche **Build-Verzeichnisse** (`build/portal` vs `build/web`)
- Unterschiedliche **Tailwind-Konfigurationen**
### Frontend-Domains teilen sich einen Port, weil:
- Beide nutzen die **gleichen Views/Components**
- Unterschiede nur in **CSS-Variablen** (Theme-Farben)
- **ThemeServiceProvider** entscheidet zur Laufzeit welches Theme geladen wird
## Development Server starten
### Option 1: Beide Server gleichzeitig starten (empfohlen)
```bash
npm run dev:all
```
Startet beide Vite-Server parallel mit `concurrently`
### Option 2: Nur Backend (Portal)
```bash
npm run dev:portal
```
- Port: 5177
- HMR-Host: assets.pr-copilot.test
- Domain: pr-copilot.test
### Option 3: Nur Frontend (Web)
```bash
npm run dev:web
```
- Port: 5178
- HMR-Host: assets-web.pr-copilot.test
- Domains: presseecho.test, businessportal24.test
## Production Build
### Alle Builds erstellen
```bash
npm run build
```
Erstellt beide Builds nacheinander
### Einzelne Builds
```bash
npm run build:portal # Nur Backend
npm run build:web # Nur Frontend
```
## Port-Übersicht
| Port | Service | Beschreibung |
|------|---------|--------------|
| 5177 | Vite Portal | Backend Dev Server mit FluxUI |
| 5178 | Vite Web | Frontend Dev Server (Presseecho & Businessportal24) |
| 33069 | MySQL | Datenbank |
| 6382 | Redis | Cache |
| 8027 | Mailpit | E-Mail Dashboard |
## Build-Verzeichnisse
```
public/
├── build/
│ ├── portal/ # Backend Assets
│ │ ├── manifest.json
│ │ └── assets/
│ └── web/ # Frontend Assets (beide Domains)
│ ├── manifest.json
│ └── assets/
```
## Theme-System
### Backend (Portal)
- **Domain:** pr-copilot.test
- **Theme:** `portal`
- **CSS:** `resources/css/portal.css`
- **Views:** `resources/views/portal/**`
- **FluxUI:** Ja (flux-pro/flux)
### Frontend (Presseecho)
- **Domain:** presseecho.test
- **Theme:** `presseecho`
- **CSS:** `resources/css/web/theme-presseecho.css`
- **Views:** `resources/views/web/**`
- **Farben:** Über CSS-Variablen in theme-presseecho.css
### Frontend (Businessportal24)
- **Domain:** businessportal24.test
- **Theme:** `businessportal24`
- **CSS:** `resources/css/web/theme-businessportal24.css`
- **Views:** `resources/views/web/**`
- **Farben:** Über CSS-Variablen in theme-businessportal24.css
## Traefik / HMR-Setup
Beide Vite-Server laufen intern auf HTTP (`https: false`), Traefik übernimmt SSL-Terminierung:
- **Portal HMR:** `wss://assets.pr-copilot.test` → Port 5177
- **Web HMR:** `wss://assets-web.pr-copilot.test` → Port 5178
## Troubleshooting
### HMR funktioniert nicht
1. Prüfe ob beide Vite-Server laufen: `npm run dev:all`
2. Prüfe Traefik-Routing für HMR-Hosts
3. Browser-Console checken für WebSocket-Fehler
### Styles werden nicht geladen
1. Prüfe ob der richtige Vite-Server für die Domain läuft
2. Prüfe `ThemeServiceProvider` Konfiguration
3. Build-Manifest prüfen: `public/build/portal/manifest.json` oder `public/build/web/manifest.json`
### Port bereits belegt
```bash
# Port-Nutzung prüfen
lsof -i :5177
lsof -i :5178
# Prozess beenden
kill -9 <PID>
```
## Deprecated Files
Diese Dateien werden nicht mehr verwendet:
- ❌ `vite.config.js` (alt)
- ❌ `tailwind.config.js` (alt)
Sie bleiben nur als Referenz erhalten.

View file

@ -0,0 +1,109 @@
# ⚠️ WICHTIG: Nächste Schritte
## ✅ Was wurde bereits erledigt
1. ✅ `docker-compose.yml` aktualisiert mit neuen Asset-Domains
2. ✅ `ThemeHelper.php` erweitert mit `getAssetUrl()` Methode
3. ✅ `AppServiceProvider.php` aktualisiert für dynamische Asset-URLs
4. ✅ `vite.web.config.js` vorbereitet für domain-spezifische Assets
5. ✅ Laravel Cache geleert
6. ✅ Vite-Server gestartet (laufen auf Port 5177 und 5178)
## 🔴 ERFORDERLICH: Docker Container neu starten
**Die Traefik-Konfiguration wurde geändert, daher MUSST du die Container neu starten!**
### Auf deinem Host-System (NICHT im DevContainer):
```bash
# Im Projektverzeichnis (wo docker-compose.yml liegt)
docker compose restart
# ODER komplett neu starten für saubere Umgebung:
docker compose down
docker compose up -d
```
## 📋 DNS-Einträge hinzufügen
Füge diese Zeilen zu deiner **Hosts-Datei** auf dem **Host-System** hinzu:
**macOS/Linux**: `/etc/hosts`
```bash
sudo nano /etc/hosts
```
**Windows**: `C:\Windows\System32\drivers\etc\hosts` (als Administrator öffnen)
**Einträge:**
```
127.0.0.1 assets.pr-copilot.test
127.0.0.1 assets.presseecho.test
127.0.0.1 assets.businessportal24.test
```
## 🧪 Nach dem Neustart testen
Zurück im DevContainer:
```bash
# Vite-Server sind bereits gestartet, check den Status:
tail -20 /tmp/vite-server.log
# Teste die Asset-URLs:
curl -Ik https://assets.pr-copilot.test/@vite/client
curl -Ik https://assets.presseecho.test/@vite/client
curl -Ik https://assets.businessportal24.test/@vite/client
# Alle sollten HTTP 200 oder 304 zurückgeben
```
## 🌐 Im Browser testen
Öffne:
- https://businessportal24.test
- https://presseecho.test
- https://pr-copilot.test
Die Assets sollten nun korrekt über HTTPS von den jeweiligen Asset-Subdomains geladen werden!
## 🎯 Neue URL-Struktur
| Hauptdomain | Asset-Domain | Port | Build-Dir |
|------------|-------------|------|-----------|
| pr-copilot.test | assets.pr-copilot.test | 5177 | public/build/portal |
| presseecho.test | assets.presseecho.test | 5178 | public/build/web |
| businessportal24.test | assets.businessportal24.test | 5178 | public/build/web |
## 📖 Weitere Dokumentation
- `VITE-SETUP-NEUE-STRUKTUR.md` - Detaillierte Erklärung der neuen Struktur
- `setup-new-asset-urls.sh` - Setup-Script (optional)
## ❓ Probleme?
Falls nach dem Neustart immer noch Fehler auftreten:
1. **Cache komplett leeren:**
```bash
php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:clear
```
2. **Vite-Server neu starten:**
```bash
pkill -f "vite --config"
npm run dev:all > /tmp/vite-server.log 2>&1 &
```
3. **Browser Hard-Refresh:**
- Chrome/Firefox: `Ctrl + Shift + R` (Windows/Linux)
- Safari: `Cmd + Shift + R` (macOS)
4. **Traefik Logs prüfen** (auf Host-System):
```bash
docker compose logs traefik | tail -50
```

View file

@ -0,0 +1,285 @@
# Zusammenfassung: Multi-Domain Vite-Setup
## Antwort auf die Hauptfrage: Reicht ein Vite-Port?
### ❌ NEIN - Ein Port reicht NICHT aus!
Du benötigst **mindestens 2 Vite-Ports**:
- **Port 5177** für Portal (Backend mit FluxUI)
- **Port 5178** für Web (Frontend: Presseecho & Businessportal24)
## Begründung
### Warum 2 Ports?
1. **Unterschiedliche Vite-Konfigurationen**
- Portal: Verwendet FluxUI (flux-pro/flux)
- Web: Kein FluxUI, nur Tailwind CSS
2. **Unterschiedliche Tailwind-Konfigurationen**
- Portal: `tailwind.portal.config.js` (mit FluxUI-Content-Paths)
- Web: `tailwind.web.config.js` (ohne FluxUI)
3. **Unterschiedliche Build-Verzeichnisse**
- Portal: `public/build/portal`
- Web: `public/build/web`
4. **Vite-Limitierung**
- Ein Vite Dev Server kann nur **eine Konfiguration** gleichzeitig ausführen
- Für verschiedene Configs = separate Vite-Prozesse = separate Ports
### Warum können Presseecho & Businessportal24 einen Port teilen?
1. **Gleiche Views/Components**
- Beide nutzen `resources/views/web/**`
- Gleiche Blade-Templates und Livewire-Components
2. **Gleiche Vite-Konfiguration**
- Beide laden die gleichen CSS-Input-Dateien
- Beide bauen nach `public/build/web`
3. **Theme-Unterschiede nur in CSS-Variablen**
- Presseecho: Grüne Farben (#345636, #6b8f71)
- Businessportal24: Rote Farben (#cf3628, #f0834a)
- Unterschiede werden durch CSS Custom Properties gesteuert
4. **Runtime-Entscheidung**
- `ThemeServiceProvider` erkennt die Domain zur Laufzeit
- Lädt automatisch die richtige Theme-CSS-Datei
## Architektur-Übersicht
```
┌─────────────────────────────────────────────────────────────┐
│ Docker Container │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Vite Portal │ │ Vite Web │ │
│ │ Port: 5177 │ │ Port: 5178 │ │
│ │ │ │ │ │
│ │ - FluxUI ✅ │ │ - FluxUI ❌ │ │
│ │ - portal.css │ │ - presseecho │ │
│ │ - build/portal │ │ - businessp24 │ │
│ │ │ │ - build/web │ │
│ └──────────────────┘ └──────────────────┘ │
│ ↓ ↓ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ pr-copilot.test │ │ presseecho.test │ │
│ │ │ │ businessp24.test│ │
│ └──────────────────┘ └──────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
## Vorgenommene Änderungen
### 1. Vite-Konfigurationen aktualisiert
#### ✅ `vite.portal.config.js`
- Port: **5177**
- Input: `resources/css/portal.css`
- Build: `public/build/portal`
- HMR: `assets.pr-copilot.test`
- FluxUI: ✅ Ja
#### ✅ `vite.web.config.js`
- Port: **5178** (geändert von 5177!)
- Input: `theme-presseecho.css`, `theme-businessportal24.css`
- Build: `public/build/web`
- HMR: `assets-web.pr-copilot.test`
- FluxUI: ❌ Nein
#### ❌ `vite.config.js` (deprecated)
- Als DEPRECATED markiert
- Wird nicht mehr verwendet
### 2. Tailwind-Konfigurationen aktualisiert
#### ✅ `tailwind.portal.config.js`
- Content-Pfade für Portal + FluxUI
- Dokumentation hinzugefügt
#### ✅ `tailwind.web.config.js`
- Content-Pfade für Web (ohne FluxUI)
- Dokumentation hinzugefügt
#### ❌ `tailwind.config.js` (deprecated)
- Als DEPRECATED markiert
- Wird nicht mehr verwendet
### 3. Neue CSS-Theme-Dateien erstellt
#### ✅ `resources/css/web/shared-styles.css`
- Gemeinsame Styles für beide Frontend-Themes
- Typography, Components, Utilities
#### ✅ `resources/css/web/theme-presseecho.css`
- Primary: #345636 (Grün)
- Secondary: #6b8f71 (Hellgrün)
- Font: Montserrat
- CSS-Variablen für HSL-Farben
- Dark-Mode-Support
#### ✅ `resources/css/web/theme-businessportal24.css`
- Primary: #cf3628 (Rot)
- Secondary: #f0834a (Orange)
- Font: Montserrat
- CSS-Variablen für HSL-Farben
- Dark-Mode-Support
### 4. `package.json` Scripts aktualisiert
```json
{
"dev": "Hinweismeldung",
"dev:portal": "vite --config vite.portal.config.js",
"dev:web": "vite --config vite.web.config.js",
"dev:all": "concurrently beide gleichzeitig",
"build": "beide Builds nacheinander",
"build:portal": "nur Portal",
"build:web": "nur Web"
}
```
### 5. `devcontainer.json` aktualisiert
- Port **5178** zu forwardPorts hinzugefügt
- Port-Label aktualisiert
### 6. Dokumentation erstellt
- ✅ `VITE-SETUP.md` - Technische Vite-Dokumentation
- ✅ `THEME-INTEGRATION.md` - Integration in Blade-Templates
- ✅ `ZUSAMMENFASSUNG-VITE-SETUP.md` - Diese Datei
## So startest du die Dev-Server
### Option 1: Beide gleichzeitig (empfohlen)
```bash
npm run dev:all
```
Startet:
- Portal auf Port 5177
- Web auf Port 5178
### Option 2: Nur Backend
```bash
npm run dev:portal
```
### Option 3: Nur Frontend
```bash
npm run dev:web
```
## Production Builds
```bash
# Alle Builds erstellen
npm run build
# Nur Portal
npm run build:portal
# Nur Web
npm run build:web
```
## URLs für Development
| URL | Vite-Port | Theme | FluxUI |
|-----|-----------|-------|--------|
| https://pr-copilot.test | 5177 | portal | ✅ |
| https://presseecho.test | 5178 | presseecho | ❌ |
| https://businessportal24.test | 5178 | businessportal24 | ❌ |
## HMR (Hot Module Replacement)
- **Portal:** `wss://assets.pr-copilot.test` → Port 5177
- **Web:** `wss://assets-web.pr-copilot.test` → Port 5178
⚠️ **Wichtig:** Traefik muss beide HMR-Hosts routen!
## Nächste Schritte
### 1. Traefik-Konfiguration prüfen
Stelle sicher, dass Traefik beide Vite-Ports routet:
```yaml
# docker-compose.yml oder traefik.yml
labels:
# Portal Assets
- "traefik.http.routers.vite-portal.rule=Host(`assets.pr-copilot.test`)"
- "traefik.http.routers.vite-portal.service=vite-portal"
- "traefik.http.services.vite-portal.loadbalancer.server.port=5177"
# Web Assets
- "traefik.http.routers.vite-web.rule=Host(`assets-web.pr-copilot.test`)"
- "traefik.http.routers.vite-web.service=vite-web"
- "traefik.http.services.vite-web.loadbalancer.server.port=5178"
```
### 2. DNS/Hosts-Datei aktualisieren
```
127.0.0.1 pr-copilot.test
127.0.0.1 presseecho.test
127.0.0.1 businessportal24.test
127.0.0.1 assets.pr-copilot.test
127.0.0.1 assets-web.pr-copilot.test
```
### 3. Blade-Templates aktualisieren
Siehe `THEME-INTEGRATION.md` für Details zur Integration in Templates.
Beispiel für Web-Layout:
```blade
@if($theme === 'presseecho')
@vite(['resources/css/web/theme-presseecho.css', 'resources/js/app.js'])
@elseif($theme === 'businessportal24')
@vite(['resources/css/web/theme-businessportal24.css', 'resources/js/app.js'])
@endif
```
### 4. Alte Theme-Dateien aufräumen (optional)
Diese Dateien werden nicht mehr benötigt:
- `resources/css/web/theme-main.css`
- `resources/css/web/theme-landing1.css`
- `resources/css/web/theme-landing2.css`
### 5. Testen
```bash
# 1. Dev-Server starten
npm run dev:all
# 2. Browser öffnen
# - https://pr-copilot.test (Backend)
# - https://presseecho.test (Frontend Grün)
# - https://businessportal24.test (Frontend Rot)
# 3. HMR testen
# - Datei ändern
# - Browser sollte auto-refresh
```
## Vorteile dieser Lösung
**Saubere Trennung**: Backend und Frontend komplett getrennt
**FluxUI isoliert**: Nur im Backend verfügbar
**Effizient**: Frontend-Domains teilen Build-Pipeline
**Flexibel**: Neue Themes einfach durch neue CSS-Dateien hinzufügbar
**Developer-freundlich**: HMR funktioniert für alle Domains
**Production-ready**: Separate Builds für optimale Performance
## Fragen?
- Technische Details → `VITE-SETUP.md`
- Blade-Integration → `THEME-INTEGRATION.md`
- Domain-Konfiguration → `config/domains.php`
- Theme-Provider → `app/Providers/ThemeServiceProvider.php`

View file

@ -0,0 +1,40 @@
<?php
namespace App\Actions\Fortify;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\CreatesNewUsers;
class CreateNewUser implements CreatesNewUsers
{
use PasswordValidationRules;
/**
* Validate and create a newly registered user.
*
* @param array<string, string> $input
*/
public function create(array $input): User
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => [
'required',
'string',
'email',
'max:255',
Rule::unique(User::class),
],
'password' => $this->passwordRules(),
])->validate();
return User::create([
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
]);
}
}

View file

@ -0,0 +1,18 @@
<?php
namespace App\Actions\Fortify;
use Illuminate\Validation\Rules\Password;
trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array<int, \Illuminate\Contracts\Validation\Rule|array<mixed>|string>
*/
protected function passwordRules(): array
{
return ['required', 'string', Password::default(), 'confirmed'];
}
}

View file

@ -0,0 +1,29 @@
<?php
namespace App\Actions\Fortify;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\ResetsUserPasswords;
class ResetUserPassword implements ResetsUserPasswords
{
use PasswordValidationRules;
/**
* Validate and reset the user's forgotten password.
*
* @param array<string, string> $input
*/
public function reset(User $user, array $input): void
{
Validator::make($input, [
'password' => $this->passwordRules(),
])->validate();
$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace App\Actions\Fortify;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
class UpdateUserPassword implements UpdatesUserPasswords
{
use PasswordValidationRules;
/**
* Validate and update the user's password.
*
* @param array<string, string> $input
*/
public function update(User $user, array $input): void
{
Validator::make($input, [
'current_password' => ['required', 'string', 'current_password:web'],
'password' => $this->passwordRules(),
], [
'current_password.current_password' => __('The provided password does not match your current password.'),
])->validateWithBag('updatePassword');
$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}

View file

@ -0,0 +1,58 @@
<?php
namespace App\Actions\Fortify;
use App\Models\User;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
class UpdateUserProfileInformation implements UpdatesUserProfileInformation
{
/**
* Validate and update the given user's profile information.
*
* @param array<string, string> $input
*/
public function update(User $user, array $input): void
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => [
'required',
'string',
'email',
'max:255',
Rule::unique('users')->ignore($user->id),
],
])->validateWithBag('updateProfileInformation');
if ($input['email'] !== $user->email &&
$user instanceof MustVerifyEmail) {
$this->updateVerifiedUser($user, $input);
} else {
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
])->save();
}
}
/**
* Update the given verified user's profile information.
*
* @param array<string, string> $input
*/
protected function updateVerifiedUser(User $user, array $input): void
{
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
'email_verified_at' => null,
])->save();
$user->sendEmailVerificationNotification();
}
}

View file

@ -0,0 +1,72 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
class GenerateDomainFavicons extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'domains:generate-favicons';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generiere Favicons für alle konfigurierten Domains';
/**
* Execute the console command.
*/
public function handle()
{
$domains = config('domains');
$faviconDir = public_path('img/favicons');
// Erstelle das Favicon-Verzeichnis, wenn es nicht existiert
if (!File::exists($faviconDir)) {
File::makeDirectory($faviconDir, 0755, true);
$this->info("Verzeichnis {$faviconDir} erstellt.");
}
// Erstelle eine Liste der Themes, für die wir Favicons erstellen müssen
$themes = [];
foreach ($domains as $domain => $config) {
if (is_array($config) && isset($config['theme'])) {
$themes[$config['theme']] = [
'domain' => $domain,
'name' => $config['name'] ?? 'Website',
'color' => $config['color_scheme']['primary'] ?? '#000000',
];
}
}
// Erstelle die Favicons
foreach ($themes as $theme => $data) {
$faviconPath = "{$faviconDir}/{$theme}-favicon.ico";
// Wenn die Datei bereits existiert, frage, ob sie überschrieben werden soll
if (File::exists($faviconPath) && !$this->confirm("Favicon für '{$theme}' existiert bereits. Überschreiben?")) {
$this->info("Favicon für '{$theme}' übersprungen.");
continue;
}
// Hier könntest du mit einer externen Bibliothek einen Favicon erstellen
// Da dies aber komplex sein kann, erstellen wir erstmal nur Platzhalter-Dateien
File::put($faviconPath, '');
$this->info("Platzhalter-Favicon für '{$theme}' erstellt: {$faviconPath}");
$this->comment("Ersetze diese Datei mit einem echten Favicon für {$data['domain']} ({$data['name']})");
}
$this->info('Favicons wurden erfolgreich erstellt!');
$this->line('Denke daran, die Platzhalter-Dateien mit echten Favicons zu ersetzen.');
}
}

View file

@ -0,0 +1,138 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
// Import der Models für die NEUE Struktur
use App\Models\User as NewUser;
use App\Models\Article as NewArticle;
use App\Models\Brand;
// Import der Models für die ALTE Struktur
use App\Models\Legacy\Presseecho\User as LegacyUser;
use App\Models\Legacy\Presseecho\Article as LegacyArticle;
class MigratePresseechoData extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'migrate:presseecho';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrates all data from the old presseecho.de database to the new central database';
/**
* Execute the console command.
*/
public function handle()
{
$this->info('Starting migration for presseecho.de...');
// Holen der Brand-ID für Presseecho aus der neuen DB
$brand = Brand::where('domain', 'presseecho.de')->first();
if (!$brand) {
$this->error('Brand "presseecho.de" not found in the new database. Please seed brands first.');
return 1;
}
// Deaktivieren von Foreign Key Checks für reibungsloses Einfügen
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=0;');
// Starten der einzelnen Migrationsschritte
$this->migrateUsers();
$this->migrateArticles($brand->id);
// $this->migrateCategories($brand->id); // Weitere Schritte hier hinzufügen
// Reaktivieren der Foreign Key Checks
DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=1;');
$this->info('Migration for presseecho.de completed successfully!');
return 0;
}
private function migrateUsers()
{
$this->line('Migrating users...');
$progressBar = $this->output->createProgressBar(LegacyUser::count());
$progressBar->start();
// Chunking verwenden, um den Speicher bei vielen Nutzern zu schonen
LegacyUser::chunk(200, function ($legacyUsers) use ($progressBar) {
foreach ($legacyUsers as $legacyUser) {
// Prüfen, ob der Nutzer (anhand der E-Mail) bereits in der neuen DB existiert
$existingUser = NewUser::where('email', $legacyUser->email)->first();
if (!$existingUser) {
// Nutzer existiert noch nicht -> neu anlegen
NewUser::create([
'name' => $legacyUser->name,
'email' => $legacyUser->email,
'password' => $legacyUser->password, // Annahme: Passwörter sind bereits gehasht. Wenn nicht: Hash::make(Str::random(16)) und Passwort-Reset erzwingen
'email_verified_at' => $legacyUser->created_at, // oder ein anderer Zeitstempel
'created_at' => $legacyUser->created_at,
'updated_at' => $legacyUser->updated_at,
// ... weitere Felder mappen
]);
}
$progressBar->advance();
}
});
$progressBar->finish();
$this->newLine(2);
}
private function migrateArticles(int $brandId)
{
$this->line('Migrating articles...');
$progressBar = $this->output->createProgressBar(LegacyArticle::count());
$progressBar->start();
LegacyArticle::chunk(200, function ($legacyArticles) use ($brandId, $progressBar) {
foreach ($legacyArticles as $legacyArticle) {
// Den zugehörigen Nutzer in der NEUEN Datenbank finden
$author = NewUser::where('email', $legacyArticle->author_email)->first(); // Annahme: Artikel hat eine Autoren-E-Mail
if (!$author) {
$this->warn("Skipping article ID {$legacyArticle->id}, author with email {$legacyArticle->author_email} not found.");
continue; // Artikel überspringen, wenn kein Autor gefunden wurde
}
// Neuen Artikel in der zentralen DB erstellen
$newArticle = NewArticle::create([
'user_id' => $author->id,
'title' => $legacyArticle->title,
'slug' => $legacyArticle->slug, // oder neu generieren: Str::slug($legacyArticle->title)
'content' => $legacyArticle->body, // Spaltennamen anpassen
'created_at' => $legacyArticle->created_at,
'updated_at' => $legacyArticle->updated_at,
// ... weitere Felder mappen
]);
// Den Artikel mit der Plattform "Presseecho" verknüpfen
// Dies fügt den Eintrag in die Pivot-Tabelle `article_platform` ein
$newArticle->platforms()->attach($brandId, [
'status' => 'published', // oder den alten Status übernehmen
'published_at' => $legacyArticle->published_date,
// eventuell weitere Pivot-Daten
]);
$progressBar->advance();
}
});
$progressBar->finish();
$this->newLine(2);
}
}

36
app/Console/Kernel.php Normal file
View file

@ -0,0 +1,36 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\App\Console\Commands\GenerateDomainFavicons::class,
];
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

117
app/Helpers/ThemeHelper.php Normal file
View file

@ -0,0 +1,117 @@
<?php
namespace App\Helpers;
class ThemeHelper
{
/**
* Get the logo path based on the current theme
*/
public static function getLogoPath(string $type = 'positive'): string
{
$theme = config('app.theme', 'pr-copilot');
$logoMap = [
'portal' => [
'positive' => 'img/logos/portal-logo-positive.svg',
'negative' => 'img/logos/portal-logo-negative.svg'
],
'presseecho' => [
'positive' => 'img/logos/presseecho-logo-positiv.svg',
'negative' => 'img/logos/presseecho-logo-negativ.svg'
],
'businessportal24' => [
'positive' => 'img/logos/businessportal24-logo-positiv.svg',
'negative' => 'img/logos/businessportal24-logo-negativ.svg'
]
];
return $logoMap[$theme][$type] ?? $logoMap['pr-copilot'][$type];
}
/**
* Get the favicon path based on the current theme
*/
public static function getFaviconPath(): string
{
$theme = config('app.theme', 'portal');
return "img/favicons/{$theme}-favicon.ico";
}
/**
* Get the CSS theme file based on the current theme
*/
public static function getThemeCssPath(): string
{
$theme = config('app.theme', 'portal');
return "resources/css/web/theme-{$theme}.css";
}
/**
* Get domain-specific configuration
*/
public static function getDomainConfig(): array
{
$theme = config('app.theme', 'portal');
return config("domains.domains.{$theme}", []);
}
/**
* Get primary color for the current theme
*/
public static function getPrimaryColor(): string
{
$config = self::getDomainConfig();
return $config['color_scheme']['primary'] ?? '#526266';
}
/**
* Get secondary color for the current theme
*/
public static function getSecondaryColor(): string
{
$config = self::getDomainConfig();
return $config['color_scheme']['secondary'] ?? '#82a0a7';
}
/**
* Get primary font family for the current theme
*/
public static function getFont(): string
{
$config = self::getDomainConfig();
return $config['font'] ?? 'Montserrat';
}
/**
* Get domain name for the current theme
*/
public static function getDomainName(): string
{
$config = self::getDomainConfig();
return $config['domain_name'] ?? 'pr-copilot.test';
}
public static function getDomainUrl(): string
{
$config = self::getDomainConfig();
return $config['url'] ?? config('app.url');
}
/**
* Get the asset URL (Vite dev server) for the current theme
*/
public static function getAssetUrl(): string
{
$theme = config('app.theme', 'portal');
$assetUrlMap = [
'portal' => 'https://assets.pr-copilot.test',
'presseecho' => 'https://assets.presseecho.test',
'businessportal24' => 'https://assets.businessportal24.test',
];
return $assetUrlMap[$theme] ?? 'https://assets.pr-copilot.test';
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\EmailVerificationRequest;
use Illuminate\Http\RedirectResponse;
class VerifyEmailController extends Controller
{
/**
* Mark the authenticated user's email address as verified.
*/
public function __invoke(EmailVerificationRequest $request): RedirectResponse
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
}
if ($request->user()->markEmailAsVerified()) {
/** @var \Illuminate\Contracts\Auth\MustVerifyEmail $user */
$user = $request->user();
event(new Verified($user));
}
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
}
}

View file

@ -0,0 +1,8 @@
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}

View file

@ -0,0 +1,22 @@
<?php
namespace App\Livewire\Actions;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class Logout
{
/**
* Log the current user out of the application.
*/
public function __invoke()
{
Auth::guard('web')->logout();
Session::invalidate();
Session::regenerateToken();
return redirect('/');
}
}

62
app/Models/User.php Normal file
View file

@ -0,0 +1,62 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Str;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasApiTokens, HasFactory, Notifiable, HasRoles, TwoFactorAuthenticatable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
/**
* Get the user's initials
*/
public function initials(): string
{
return Str::of($this->name)
->explode(' ')
->map(fn (string $name) => Str::of($name)->substr(0, 1))
->implode('');
}
}

View file

@ -0,0 +1,51 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Force HTTPS when running behind a proxy (like Traefik)
if ($this->app->environment('local', 'production')) {
URL::forceScheme('https');
}
// Trust proxies for correct request detection
$this->app['request']->server->set('HTTPS', 'on');
// Set dynamic asset URL based on current domain/theme
// This is needed for Vite to use the correct asset subdomain
//config(['app.asset_url' => 'https://assets.businessportal24.test']);
//$this->setDynamicAssetUrl();
}
/**
* Set the asset URL dynamically based on the current theme
*/
protected function setDynamicAssetUrl(): void
{
try {
$assetUrl = \App\Helpers\ThemeHelper::getAssetUrl();
config(['app.asset_url' => $assetUrl]);
} catch (\Exception $e) {
// Fallback to default if theme detection fails
config(['app.asset_url' => 'https://assets.pr-copilot.test']);
}
}
}

View file

@ -0,0 +1,52 @@
<?php
namespace App\Providers;
use App\Actions\Fortify\CreateNewUser;
use App\Actions\Fortify\ResetUserPassword;
use App\Actions\Fortify\UpdateUserPassword;
use App\Actions\Fortify\UpdateUserProfileInformation;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Laravel\Fortify\Actions\RedirectIfTwoFactorAuthenticatable;
use Laravel\Fortify\Fortify;
use Livewire\Volt\Volt;
class FortifyServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Nur die notwendigen Fortify-Aktionen behalten
Fortify::createUsersUsing(CreateNewUser::class);
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
Fortify::updateUserPasswordsUsing(UpdateUserPassword::class);
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
Fortify::redirectUserForTwoFactorAuthenticationUsing(RedirectIfTwoFactorAuthenticatable::class);
// Keine View-Definitionen, da wir Volt verwenden
RateLimiter::for('login', function (Request $request) {
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip());
return Limit::perMinute(5)->by($throttleKey);
});
RateLimiter::for('two-factor', function (Request $request) {
return Limit::perMinute(5)->by($request->session()->get('login.id'));
});
}
}

View file

@ -0,0 +1,90 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
class ThemeServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
// Registriere die domains.php Konfigurationsdatei
$this->mergeConfigFrom(
base_path('config/domains.php'),
'domains'
);
}
/**
* Bootstrap services.
*/
public function boot(): void
{
$host = Request::getHost(); // is domain_name
$themeOverride = Request::get('theme'); // Allow theme override via URL parameter
// Standard-Werte für Domain, die nicht in der Konfiguration sind
$domainConfig = [
'name' => config('app.name'),
'theme' => 'portal',
'view_prefix' => 'portal',
'assets_dir' => 'build/portal',
'url' => config('app.url'),
'domain_name' => config('app.domain_name'),
];
// Lade die Domain-Konfiguration
$confiDomains = config('domains.domains');
// Suche nach der aktuellen Domain in der Konfiguration
foreach ($confiDomains as $name => $config) {
if (is_array($config) && isset($config['domain_name']) && $config['domain_name'] === $host) {
$domainConfig = array_merge($domainConfig, $config);
break;
}
}
// Allow theme override via URL parameter (for testing)
if ($themeOverride && isset($confiDomains[$themeOverride])) {
$domainConfig = array_merge($domainConfig, $confiDomains[$themeOverride]);
}
// Grundlegende Konfiguration im Anwendungskontext verfügbar machen
config([
'app.theme' => $domainConfig['theme'],
'app.view_prefix' => $domainConfig['view_prefix'],
'app.domain_name' => $domainConfig['domain_name'],
'app.url' => $domainConfig['url'],
'app.asset_url' => $domainConfig['asset_url'] ?? $domainConfig['url'],
]);
// Spezifischere Daten für die Views verfügbar machen
View::share('theme', $domainConfig['theme']);
View::share('viewPrefix', $domainConfig['view_prefix']);
View::share('domainName', $domainConfig['domain_name']);
View::share('domainConfig', $domainConfig);
View::share('domainUrl', $domainConfig['url']);
// Vite-Assets-Konfiguration für die aktuelle Domain
if (! app()->runningInConsole() && isset($domainConfig['assets_dir'])) {
Vite::useBuildDirectory($domainConfig['assets_dir']);
// Setze die Asset-URL für Vite Dev-Server
if (isset($domainConfig['asset_url'])) {
// Erstelle temporäre Hot-File mit der richtigen Asset-URL
$hotFile = public_path('hot');
if (file_exists($hotFile)) {
file_put_contents($hotFile, $domainConfig['asset_url']);
}
Vite::useHotFile($hotFile);
}
}
}
}

View file

@ -0,0 +1,28 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Livewire\Volt\Volt;
class VoltServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}
/**
* Bootstrap services.
*/
public function boot(): void
{
Volt::mount([
config('livewire.view_path', resource_path('views/livewire')),
resource_path('views/pages'),
]);
}
}

18
artisan Executable file
View file

@ -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);

25
bootstrap/app.php Normal file
View file

@ -0,0 +1,25 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__ . '/../routes/domains.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
// Trust all proxies (for Traefik/Docker setup)
$middleware->trustProxies(
at: '*',
headers: \Illuminate\Http\Request::HEADER_X_FORWARDED_FOR |
\Illuminate\Http\Request::HEADER_X_FORWARDED_HOST |
\Illuminate\Http\Request::HEADER_X_FORWARDED_PORT |
\Illuminate\Http\Request::HEADER_X_FORWARDED_PROTO
);
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();

2
bootstrap/cache/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

9
bootstrap/providers.php Normal file
View file

@ -0,0 +1,9 @@
<?php
return [
App\Providers\AppServiceProvider::class,
App\Providers\FortifyServiceProvider::class,
App\Providers\ThemeServiceProvider::class,
App\Providers\VoltServiceProvider::class,
Barryvdh\Debugbar\ServiceProvider::class,
];

93
composer.json Normal file
View file

@ -0,0 +1,93 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "laravel/livewire-starter-kit",
"type": "project",
"description": "The official Laravel starter kit for Livewire.",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"require": {
"php": "^8.2",
"laravel/fortify": "^1.27",
"laravel/framework": "^12.0",
"laravel/sanctum": "^4.1",
"laravel/tinker": "^2.10.1",
"livewire/flux": "^2.1.1",
"livewire/flux-pro": "^2.1",
"livewire/volt": "^1.7.0",
"spatie/laravel-permission": "^6.17"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.16",
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.18",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"pestphp/pest": "^3.8",
"pestphp/pest-plugin-laravel": "^3.2",
"reliese/laravel": "^1.4"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"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"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
],
"test": [
"@php artisan config:clear --ansi",
"@php artisan test"
]
},
"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,
"repositories": {
"flux-pro": {
"type": "composer",
"url": "https://composer.fluxui.dev"
}
}
}

10426
composer.lock generated Normal file

File diff suppressed because it is too large Load diff

126
config/app.php Normal file
View file

@ -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', 'en'),
'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(',', 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"
|
*/
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
];

115
config/auth.php Normal file
View file

@ -0,0 +1,115 @@
<?php
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',
],
],
/*
|--------------------------------------------------------------------------
| 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', App\Models\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 amount 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),
];

108
config/cache.php Normal file
View file

@ -0,0 +1,108 @@
<?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", "octane", "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/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',
],
],
/*
|--------------------------------------------------------------------------
| 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(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

211
config/database.php Normal file
View file

@ -0,0 +1,211 @@
<?php
use Illuminate\Support\Str;
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,
],
'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([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mysql_presseecho' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST_PRESSEECHO', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE_PRESSEECHO', 'laravel'),
'username' => env('DB_USERNAME_PRESSEECHO', 'root'),
'password' => env('DB_PASSWORD_PRESSEECHO', ''),
'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([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mysql_businessportal' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST_BUSINESSPORTAL', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE_BUSINESSPORTAL', 'laravel'),
'username' => env('DB_USERNAME_BUSINESSPORTAL', 'root'),
'password' => env('DB_PASSWORD_BUSINESSPORTAL', ''),
'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([
PDO::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([
PDO::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' => '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(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'),
],
'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'),
],
],
];

73
config/domains.php Normal file
View file

@ -0,0 +1,73 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Domain-Konfigurationen
|--------------------------------------------------------------------------
|
| Diese Konfiguration definiert die verschiedenen Domains und deren
| zugehörige Einstellungen wie Theme, View-Präfix und andere
| domainspezifische Konfigurationen.
|
*/
'protocol' => env('APP_PROTOCOL', 'https://'),
'domain_portal' => env('APP_PORTAL_NAME', 'pr-copilot.test'),
'domain_presseecho' => env('APP_PRESSEECHO_NAME', 'presseecho.test'),
'domain_businessportal' => env('APP_BUSINESSPORTAL_NAME', 'businessportal24.test'),
'domain_portal_url' => env('APP_PORTAL_URL', 'https://pr-copilot.test'),
'domain_presseecho_url' => env('APP_PRESSEECHO_URL', 'https://presseecho.test'),
'domain_businessportal_url' => env('APP_BUSINESSPORTAL_URL', 'https://businessportal24.test'),
'domains' => [
'portal' => [
'domain_name' => env('APP_PORTAL_NAME', 'pr-copilot.test'),
'url' => env('APP_PORTAL_URL', 'https://pr-copilot.test'),
'asset_url' => 'https://assets.pr-copilot.test',
'theme' => 'main',
'view_prefix' => 'portal',
'assets_dir' => 'build/portal',
'description' => 'Backend Page PR-Copilot',
'color_scheme' => [
'primary' => env('APP_PORTAL_PRIMARY', '#526266'), //
'secondary' => env('APP_PORTAL_SECONDARY', '#82a0a7'), //
],
'font' => 'Montserrat',
],
'presseecho' => [
'domain_name' => env('APP_PRESSEECHO_NAME', 'presseecho.test'),
'url' => env('APP_PRESSEECHO_URL', 'https://presseecho.test'),
'asset_url' => 'https://assets.presseecho.test',
'theme' => 'presseecho',
'view_prefix' => 'web',
'assets_dir' => 'build/web',
'description' => 'Frontend Page Presseecho',
'color_scheme' => [
'primary' => env('APP_PRESSEECHO_PRIMARY', '#345636'), //
'secondary' => env('APP_PRESSEECHO_SECONDARY', '#6b8f71'), //
],
'font' => 'Montserrat',
],
'businessportal24' => [
'domain_name' => env('APP_BUSINESSPORTAL_NAME', 'businessportal24.test'),
'url' => env('APP_BUSINESSPORTAL_URL', 'https://businessportal24.test'),
'asset_url' => 'https://assets.businessportal24.test',
'theme' => 'businessportal24',
'view_prefix' => 'web',
'assets_dir' => 'build/web',
'description' => 'Frontend Page Businessportal24',
'color_scheme' => [
'primary' => env('APP_BUSINESSPORTAL_PRIMARY', '#cf3628'), //
'secondary' => env('APP_BUSINESSPORTAL_SECONDARY', '#f0834a'), //
],
'font' => 'Montserrat',
],
],
];

80
config/filesystems.php Normal file
View file

@ -0,0 +1,80 @@
<?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' => env('APP_URL').'/storage',
'visibility' => 'public',
'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'),
],
];

159
config/fortify.php Normal file
View file

@ -0,0 +1,159 @@
<?php
use Laravel\Fortify\Features;
return [
/*
|--------------------------------------------------------------------------
| Fortify Guard
|--------------------------------------------------------------------------
|
| Here you may specify which authentication guard Fortify will use while
| authenticating users. This value should correspond with one of your
| guards that is already present in your "auth" configuration file.
|
*/
'guard' => 'web',
/*
|--------------------------------------------------------------------------
| Fortify Password Broker
|--------------------------------------------------------------------------
|
| Here you may specify which password broker Fortify can use when a user
| is resetting their password. This configured value should match one
| of your password brokers setup in your "auth" configuration file.
|
*/
'passwords' => 'users',
/*
|--------------------------------------------------------------------------
| Username / Email
|--------------------------------------------------------------------------
|
| This value defines which model attribute should be considered as your
| application's "username" field. Typically, this might be the email
| address of the users but you are free to change this value here.
|
| Out of the box, Fortify expects forgot password and reset password
| requests to have a field named 'email'. If the application uses
| another name for the field you may define it below as needed.
|
*/
'username' => 'email',
'email' => 'email',
/*
|--------------------------------------------------------------------------
| Lowercase Usernames
|--------------------------------------------------------------------------
|
| This value defines whether usernames should be lowercased before saving
| them in the database, as some database system string fields are case
| sensitive. You may disable this for your application if necessary.
|
*/
'lowercase_usernames' => true,
/*
|--------------------------------------------------------------------------
| Home Path
|--------------------------------------------------------------------------
|
| Here you may configure the path where users will get redirected during
| authentication or password reset when the operations are successful
| and the user is authenticated. You are free to change this value.
|
*/
'home' => '/dashboard',
/*
|--------------------------------------------------------------------------
| Fortify Routes Prefix / Subdomain
|--------------------------------------------------------------------------
|
| Here you may specify which prefix Fortify will assign to all the routes
| that it registers with the application. If necessary, you may change
| subdomain under which all of the Fortify routes will be available.
|
*/
'prefix' => '',
'domain' => null,
/*
|--------------------------------------------------------------------------
| Fortify Routes Middleware
|--------------------------------------------------------------------------
|
| Here you may specify which middleware Fortify will assign to the routes
| that it registers with the application. If necessary, you may change
| these middleware but typically this provided default is preferred.
|
*/
'middleware' => ['web'],
/*
|--------------------------------------------------------------------------
| Rate Limiting
|--------------------------------------------------------------------------
|
| By default, Fortify will throttle logins to five requests per minute for
| every email and IP address combination. However, if you would like to
| specify a custom rate limiter to call then you may specify it here.
|
*/
'limiters' => [
'login' => 'login',
'two-factor' => 'two-factor',
],
/*
|--------------------------------------------------------------------------
| Register View Routes
|--------------------------------------------------------------------------
|
| Here you may specify if the routes returning views should be disabled as
| you may not need them when building your own application. This may be
| especially true if you're writing a custom single-page application.
|
*/
'views' => false,
/*
|--------------------------------------------------------------------------
| Features
|--------------------------------------------------------------------------
|
| Some of the Fortify features are optional. You may disable the features
| by removing them from this array. You're free to only remove some of
| these features or you can even remove all of these if you need to.
|
*/
'features' => [
// Features::registration(), // Deaktiviert, da wir Volt verwenden
// Features::resetPasswords(), // Deaktiviert, da wir Volt verwenden
// Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirm' => true,
'confirmPassword' => true,
// 'window' => 0,
]),
],
];

160
config/livewire.php Normal file
View file

@ -0,0 +1,160 @@
<?php
return [
/*
|---------------------------------------------------------------------------
| Class Namespace
|---------------------------------------------------------------------------
|
| This value sets the root class namespace for Livewire component classes in
| your application. This value will change where component auto-discovery
| finds components. It's also referenced by the file creation commands.
|
*/
'class_namespace' => 'App\\Livewire',
/*
|---------------------------------------------------------------------------
| View Path
|---------------------------------------------------------------------------
|
| This value is used to specify where Livewire component Blade templates are
| stored when running file creation commands like `artisan make:livewire`.
| It is also used if you choose to omit a component's render() method.
|
*/
'view_path' => resource_path('views/livewire'),
/*
|---------------------------------------------------------------------------
| Layout
|---------------------------------------------------------------------------
| The view that will be used as the layout when rendering a single component
| as an entire page via `Route::get('/post/create', CreatePost::class);`.
| In this case, the view returned by CreatePost will render into $slot.
|
*/
'layout' => 'components.layouts.app',
/*
|---------------------------------------------------------------------------
| Lazy Loading Placeholder
|---------------------------------------------------------------------------
| Livewire allows you to lazy load components that would otherwise slow down
| the initial page load. Every component can have a custom placeholder or
| you can define the default placeholder view for all components below.
|
*/
'lazy_placeholder' => null,
/*
|---------------------------------------------------------------------------
| Temporary File Uploads
|---------------------------------------------------------------------------
|
| Livewire handles file uploads by storing uploads in a temporary directory
| before the file is stored permanently. All file uploads are directed to
| a global endpoint for temporary storage. You may configure this below:
|
*/
'temporary_file_upload' => [
'disk' => null, // Example: 'local', 's3' | Default: 'default'
'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB)
'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp'
'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1'
'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs...
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated...
'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs...
],
/*
|---------------------------------------------------------------------------
| Render On Redirect
|---------------------------------------------------------------------------
|
| This value determines if Livewire will run a component's `render()` method
| after a redirect has been triggered using something like `redirect(...)`
| Setting this to true will render the view once more before redirecting
|
*/
'render_on_redirect' => false,
/*
|---------------------------------------------------------------------------
| Eloquent Model Binding
|---------------------------------------------------------------------------
|
| Previous versions of Livewire supported binding directly to eloquent model
| properties using wire:model by default. However, this behavior has been
| deemed too "magical" and has therefore been put under a feature flag.
|
*/
'legacy_model_binding' => false,
/*
|---------------------------------------------------------------------------
| Auto-inject Frontend Assets
|---------------------------------------------------------------------------
|
| By default, Livewire automatically injects its JavaScript and CSS into the
| <head> and <body> of pages containing Livewire components. By disabling
| this behavior, you need to use @livewireStyles and @livewireScripts.
|
*/
'inject_assets' => true,
/*
|---------------------------------------------------------------------------
| Navigate (SPA mode)
|---------------------------------------------------------------------------
|
| By adding `wire:navigate` to links in your Livewire application, Livewire
| will prevent the default link handling and instead request those pages
| via AJAX, creating an SPA-like effect. Configure this behavior here.
|
*/
'navigate' => [
'show_progress_bar' => true,
'progress_bar_color' => '#2299dd',
],
/*
|---------------------------------------------------------------------------
| HTML Morph Markers
|---------------------------------------------------------------------------
|
| Livewire intelligently "morphs" existing HTML into the newly rendered HTML
| after each update. To make this process more reliable, Livewire injects
| "markers" into the rendered Blade surrounding @if, @class & @foreach.
|
*/
'inject_morph_markers' => true,
/*
|---------------------------------------------------------------------------
| Pagination Theme
|---------------------------------------------------------------------------
|
| When enabling Livewire's pagination feature by using the `WithPagination`
| trait, Livewire will use Tailwind templates to render pagination views
| on the page. If you want Bootstrap CSS, you can specify: "bootstrap"
|
*/
'pagination_theme' => 'tailwind',
];

132
config/logging.php Normal file
View file

@ -0,0 +1,132 @@
<?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", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => explode(',', 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'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'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,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
'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'),
],
],
];

116
config/mail.php Normal file
View file

@ -0,0 +1,116 @@
<?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(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',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
|--------------------------------------------------------------------------
| 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', 'Example'),
],
];

599
config/models.php Normal file
View file

@ -0,0 +1,599 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Configurations
|--------------------------------------------------------------------------
|
| In this section you may define the default configuration for each model
| that will be generated from any database.
|
*/
'*' => [
/*
|--------------------------------------------------------------------------
| Model Files Location
|--------------------------------------------------------------------------
|
| We need a location to store your new generated files. All files will be
| placed within this directory. When you turn on base files, they will
| be placed within a Base directory inside this location.
|
*/
'path' => app_path('Models'),
/*
|--------------------------------------------------------------------------
| Model Namespace
|--------------------------------------------------------------------------
|
| Every generated model will belong to this namespace. It is suggested
| that this namespace should follow PSR-4 convention and be very
| similar to the path of your models defined above.
|
*/
'namespace' => 'App\Models',
/*
|--------------------------------------------------------------------------
| Parent Class
|--------------------------------------------------------------------------
|
| All Eloquent models should inherit from Eloquent Model class. However,
| you can define a custom Eloquent model that suits your needs.
| As an example one custom model has been added for you which
| will allow you to create custom database castings.
|
*/
'parent' => Illuminate\Database\Eloquent\Model::class,
/*
|--------------------------------------------------------------------------
| Traits
|--------------------------------------------------------------------------
|
| Sometimes you may want to append certain traits to all your models.
| If that is what you need, you may list them bellow.
| As an example we have a BitBooleans trait which will treat MySQL bit
| data type as booleans. You might probably not need it, but it is
| an example of how you can customize your models.
|
*/
'use' => [
// Reliese\Database\Eloquent\BitBooleans::class,
// Reliese\Database\Eloquent\BlamableBehavior::class,
],
/*
|--------------------------------------------------------------------------
| Model Connection
|--------------------------------------------------------------------------
|
| If you wish your models had appended the connection from which they
| were generated, you should set this value to true and your
| models will have the connection property filled.
|
*/
'connection' => false,
/*
|--------------------------------------------------------------------------
| Timestamps
|--------------------------------------------------------------------------
|
| If your tables have CREATED_AT and UPDATED_AT timestamps you may
| enable them and your models will fill their values as needed.
| You can also specify which fields should be treated as timestamps
| in case you don't follow the naming convention Eloquent uses.
| If your table doesn't have these fields, timestamps will be
| disabled for your model.
|
*/
'timestamps' => true,
// 'timestamps' => [
// 'enabled' => true,
// 'fields' => [
// 'CREATED_AT' => 'created_at',
// 'UPDATED_AT' => 'updated_at',
// ]
// ],
/*
|--------------------------------------------------------------------------
| Soft Deletes
|--------------------------------------------------------------------------
|
| If your tables support soft deletes with a DELETED_AT attribute,
| you can enable them here. You can also specify which field
| should be treated as a soft delete attribute in case you
| don't follow the naming convention Eloquent uses.
| If your table doesn't have this field, soft deletes will be
| disabled for your model.
|
*/
'soft_deletes' => true,
// 'soft_deletes' => [
// 'enabled' => true,
// 'field' => 'deleted_at',
// ],
/*
|--------------------------------------------------------------------------
| Date Format
|--------------------------------------------------------------------------
|
| Here you may define your models' date format. The following format
| is the default format Eloquent uses. You won't see it in your
| models unless you change it to a more convenient value.
|
*/
'date_format' => 'Y-m-d H:i:s',
/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
|
| Here you may define how many models Eloquent should display when
| paginating them. The default number is 15, so you might not
| see this number in your models unless you change it.
|
*/
'per_page' => 15,
/*
|--------------------------------------------------------------------------
| Base Files
|--------------------------------------------------------------------------
|
| By default, your models will be generated in your models path, but
| when you generate them again they will be replaced by new ones.
| You may want to customize your models and, at the same time, be
| able to generate them as your tables change. For that, you
| can enable base files. These files will be replaced whenever
| you generate them, but your customized files will not be touched.
|
*/
'base_files' => false,
/*
|--------------------------------------------------------------------------
| Snake Attributes
|--------------------------------------------------------------------------
|
| Eloquent treats your model attributes as snake cased attributes, but
| if you have camel-cased fields in your database you can disable
| that behaviour and use camel case attributes in your models.
|
*/
'snake_attributes' => true,
/*
|--------------------------------------------------------------------------
| Indent options
|--------------------------------------------------------------------------
|
| As default indention is done with tabs, but you can change it by setting
| this to the amount of spaces you that you want to use for indentation.
| Usually you will use 4 spaces instead of tabs.
|
*/
'indent_with_space' => 0,
/*
|--------------------------------------------------------------------------
| Qualified Table Names
|--------------------------------------------------------------------------
|
| If some of your tables have cross-database relationships (probably in
| MySQL), you can make sure your models take into account their
| respective database schema.
|
| Can Either be NULL, FALSE or TRUE
| TRUE: Schema name will be prepended on the table
| FALSE:Table name will be set without schema name.
| NULL: Table name will follow laravel pattern,
| i.e. if class name(plural) matches table name, then table name will not be added
*/
'qualified_tables' => false,
/*
|--------------------------------------------------------------------------
| Hidden Attributes
|--------------------------------------------------------------------------
|
| When casting your models into arrays or json, the need to hide some
| attributes sometimes arise. If your tables have some fields you
| want to hide, you can define them bellow.
| Some fields were defined for you.
|
*/
'hidden' => [
'*secret*', '*password', '*token',
],
/*
|--------------------------------------------------------------------------
| Mass Assignment Guarded Attributes
|--------------------------------------------------------------------------
|
| You may want to protect some fields from mass assignment. You can
| define them bellow. Some fields were defined for you.
| Your fillable attributes will be those which are not in the list
| excluding your models' primary keys.
|
*/
'guarded' => [
// 'created_by', 'updated_by'
],
/*
|--------------------------------------------------------------------------
| Casts
|--------------------------------------------------------------------------
|
| You may want to specify which of your table fields should be cast as
| something other than a string. For instance, you may want a
| text field be cast as an array or and object.
|
| You may define column patterns which will be cast using the value
| assigned. We have defined some fields for you. Feel free to
| modify them to fit your needs.
|
*/
'casts' => [
'*_json' => 'json',
],
/*
|--------------------------------------------------------------------------
| Excluded Tables
|--------------------------------------------------------------------------
|
| When performing the generation of models you may want to skip some of
| them, because you don't want a model for them or any other reason.
| You can define those tables bellow. The migrations table was
| filled for you, since you may not want a model for it.
|
*/
'except' => [
'migrations',
'failed_jobs',
'password_resets',
'personal_access_tokens',
'password_reset_tokens',
],
/*
|--------------------------------------------------------------------------
| Specified Tables
|--------------------------------------------------------------------------
|
| You can specify specific tables. This will generate the models only
| for selected tables, ignoring the rest.
|
*/
'only' => [
// 'users',
],
/*
|--------------------------------------------------------------------------
| Table Prefix
|--------------------------------------------------------------------------
|
| If you have a prefix on your table names but don't want it in the model
| and relation names, specify it here.
|
*/
'table_prefix' => '',
/*
|--------------------------------------------------------------------------
| Lower table name before doing studly
|--------------------------------------------------------------------------
|
| If tables names are capitalised using studly produces incorrect name
| this can help fix it ie TABLE_NAME now becomes TableName
|
*/
'lower_table_name_first' => false,
/*
|--------------------------------------------------------------------------
| Model Names
|--------------------------------------------------------------------------
|
| By default the generator will create models with names that match your tables.
| However, if you wish to manually override the naming, you can specify a mapping
| here between table and model names.
|
| Example:
| A table called 'billing_invoices' will generate a model called `BillingInvoice`,
| but you'd prefer it to generate a model called 'Invoice'. Therefore, you'd add
| the following array key and value:
| 'billing_invoices' => 'Invoice',
*/
'model_names' => [
],
/*
|--------------------------------------------------------------------------
| Relation Name Strategy
|--------------------------------------------------------------------------
|
| How the relations should be named in your models.
|
| 'related' Use the related table as the relation name.
| (post.author --> user.id)
generates Post::user() and User::posts()
|
| 'foreign_key' Use the foreign key as the relation name.
| This can help to provide more meaningful relationship names, and avoids naming conflicts
| if you have more than one relationship between two tables.
| (post.author_id --> user.id)
| generates Post::author() and User::posts_where_author()
| (post.editor_id --> user.id)
| generates Post::editor() and User::posts_where_editor()
| ID suffixes can be omitted from foreign keys.
| (post.author --> user.id)
| (post.editor --> user.id)
| generates the same as above.
| Where the foreign key matches the related table name, it behaves as per the 'related' strategy.
| (post.user_id --> user.id)
| generates Post::user() and User::posts()
*/
'relation_name_strategy' => 'related',
// 'relation_name_strategy' => 'foreign_key',
/*
|--------------------------------------------------------------------------
| Determines need or not to generate constants with properties names like
|
| ...
| const AGE = 'age';
| const USER_NAME = 'user_name';
| ...
|
| that later can be used in QueryBuilder like
|
| ...
| $builder->select([User::USER_NAME])->where(User::AGE, '<=', 18);
| ...
|
| that helps to avoid typos in strings when typing field names and allows to use
| code competition with available model's field names.
*/
'with_property_constants' => false,
/*
|--------------------------------------------------------------------------
| Optionally includes a full list of columns in the base generated models,
| which can be used to avoid making calls like
|
| ...
| \Illuminate\Support\Facades\Schema::getColumnListing
| ...
|
| which can be slow, especially for large tables.
*/
'with_column_list' => false,
/*
|--------------------------------------------------------------------------
| Disable Pluralization Name
|--------------------------------------------------------------------------
|
| You can disable pluralization tables and relations
|
*/
'pluralize' => true,
/*
|--------------------------------------------------------------------------
| Disable Pluralization Except For Certain Tables
|--------------------------------------------------------------------------
|
| You can enable pluralization for certain tables
|
*/
'override_pluralize_for' => [
],
/*
|--------------------------------------------------------------------------
| Move $hidden property to base files
|--------------------------------------------------------------------------
| When base_files is true you can set hidden_in_base_files to true
| if you want the $hidden to be generated in base files
|
*/
'hidden_in_base_files' => false,
/*
|--------------------------------------------------------------------------
| Move $fillable property to base files
|--------------------------------------------------------------------------
| When base_files is true you can set fillable_in_base_files to true
| if you want the $fillable to be generated in base files
|
*/
'fillable_in_base_files' => false,
/*
|--------------------------------------------------------------------------
| Generate return types for relation methods.
|--------------------------------------------------------------------------
| When enable_return_types is set to true, return type declarations are added
| to all generated relation methods for your models.
|
| NOTE: This requires PHP 7.0 or later.
|
*/
'enable_return_types' => false,
],
/*
|--------------------------------------------------------------------------
| Database Specifics
|--------------------------------------------------------------------------
|
| In this section you may define the default configuration for each model
| that will be generated from a specific database. You can also nest
| table specific configurations.
| These values will override those defined in the section above.
|
*/
// 'shop' => [
// 'path' => app_path(),
// 'namespace' => 'App',
// 'snake_attributes' => false,
// 'qualified_tables' => true,
// 'use' => [
// Reliese\Database\Eloquent\BitBooleans::class,
// ],
// 'except' => ['migrations'],
// 'only' => ['users'],
// // Table Specifics Bellow:
// 'user' => [
// // Don't use any default trait
// 'use' => [],
// ]
// ],
/*
|--------------------------------------------------------------------------
| Connection Specifics
|--------------------------------------------------------------------------
|
| In this section you may define the default configuration for each model
| that will be generated from a specific connection. You can also nest
| database and table specific configurations.
|
| You may wish to use connection specific config for setting a parent
| model with a read only setup, or enforcing a different set of rules
| for a connection, e.g. using snake_case naming over CamelCase naming.
|
| This supports nesting with the following key configuration values, in
| reverse precedence order (i.e. the last one found becomes the value).
|
| connections.{connection_name}.property
| connections.{connection_name}.{database_name}.property
| connections.{connection_name}.{table_name}.property
| connections.{connection_name}.{database_name}.{table_name}.property
|
| These values will override those defined in the section above.
|
*/
'connections' => [
'mysql_presseecho' => [
'path' => app_path('Models/Legacy/Presseecho'),
'namespace' => 'App\\Models\\Legacy\\Presseecho',
'connection' => true,
'parent' => Illuminate\Database\Eloquent\Model::class,
'timestamps' => true,
'soft_deletes' => true,
'snake_attributes' => true,
'hidden' => [
'*secret*', '*password', '*token',
],
'guarded' => [
// 'created_by', 'updated_by'
],
'casts' => [
'*_json' => 'json',
],
'except' => [
'migrations',
'failed_jobs',
'password_resets',
'personal_access_tokens',
'password_reset_tokens',
],
],
],
'pressl_db2' => [
'path' => app_path('Models/Legacy/Presseecho'),
'namespace' => 'App\\Models\\Legacy\\Presseecho',
'connection' => true,
'parent' => Illuminate\Database\Eloquent\Model::class,
'timestamps' => true,
'soft_deletes' => true,
'snake_attributes' => true,
'hidden' => [
'*secret*', '*password', '*token',
],
'guarded' => [
// 'created_by', 'updated_by'
],
'casts' => [
'*_json' => 'json',
],
'except' => [
'migrations',
'failed_jobs',
'password_resets',
'personal_access_tokens',
'password_reset_tokens',
],
],
'business_db1' => [
'path' => app_path('Models/Legacy/Businessportal'),
'namespace' => 'App\\Models\\Legacy\\Businessportal',
'connection' => true,
'parent' => Illuminate\Database\Eloquent\Model::class,
'timestamps' => true,
'soft_deletes' => true,
'snake_attributes' => true,
'hidden' => [
'*secret*', '*password', '*token',
],
'guarded' => [
// 'created_by', 'updated_by'
],
'casts' => [
'*_json' => 'json',
],
'except' => [
'migrations',
'failed_jobs',
'password_resets',
'personal_access_tokens',
'password_reset_tokens',
],
],
];

202
config/permission.php Normal file
View file

@ -0,0 +1,202 @@
<?php
return [
'models' => [
/*
* When using the "HasPermissions" trait from this package, we need to know which
* Eloquent model should be used to retrieve your permissions. Of course, it
* is often just the "Permission" model but you may use whatever you like.
*
* The model you want to use as a Permission model needs to implement the
* `Spatie\Permission\Contracts\Permission` contract.
*/
'permission' => Spatie\Permission\Models\Permission::class,
/*
* When using the "HasRoles" trait from this package, we need to know which
* Eloquent model should be used to retrieve your roles. Of course, it
* is often just the "Role" model but you may use whatever you like.
*
* The model you want to use as a Role model needs to implement the
* `Spatie\Permission\Contracts\Role` contract.
*/
'role' => Spatie\Permission\Models\Role::class,
],
'table_names' => [
/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your roles. We have chosen a basic
* default value but you may easily change it to any table you like.
*/
'roles' => 'roles',
/*
* When using the "HasPermissions" trait from this package, we need to know which
* table should be used to retrieve your permissions. We have chosen a basic
* default value but you may easily change it to any table you like.
*/
'permissions' => 'permissions',
/*
* When using the "HasPermissions" trait from this package, we need to know which
* table should be used to retrieve your models permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/
'model_has_permissions' => 'model_has_permissions',
/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your models roles. We have chosen a
* basic default value but you may easily change it to any table you like.
*/
'model_has_roles' => 'model_has_roles',
/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your roles permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/
'role_has_permissions' => 'role_has_permissions',
],
'column_names' => [
/*
* Change this if you want to name the related pivots other than defaults
*/
'role_pivot_key' => null, // default 'role_id',
'permission_pivot_key' => null, // default 'permission_id',
/*
* Change this if you want to name the related model primary key other than
* `model_id`.
*
* For example, this would be nice if your primary keys are all UUIDs. In
* that case, name this `model_uuid`.
*/
'model_morph_key' => 'model_id',
/*
* Change this if you want to use the teams feature and your related model's
* foreign key is other than `team_id`.
*/
'team_foreign_key' => 'team_id',
],
/*
* When set to true, the method for checking permissions will be registered on the gate.
* Set this to false if you want to implement custom logic for checking permissions.
*/
'register_permission_check_method' => true,
/*
* When set to true, Laravel\Octane\Events\OperationTerminated event listener will be registered
* this will refresh permissions on every TickTerminated, TaskTerminated and RequestTerminated
* NOTE: This should not be needed in most cases, but an Octane/Vapor combination benefited from it.
*/
'register_octane_reset_listener' => false,
/*
* Events will fire when a role or permission is assigned/unassigned:
* \Spatie\Permission\Events\RoleAttached
* \Spatie\Permission\Events\RoleDetached
* \Spatie\Permission\Events\PermissionAttached
* \Spatie\Permission\Events\PermissionDetached
*
* To enable, set to true, and then create listeners to watch these events.
*/
'events_enabled' => false,
/*
* Teams Feature.
* When set to true the package implements teams using the 'team_foreign_key'.
* If you want the migrations to register the 'team_foreign_key', you must
* set this to true before doing the migration.
* If you already did the migration then you must make a new migration to also
* add 'team_foreign_key' to 'roles', 'model_has_roles', and 'model_has_permissions'
* (view the latest version of this package's migration file)
*/
'teams' => false,
/*
* The class to use to resolve the permissions team id
*/
'team_resolver' => \Spatie\Permission\DefaultTeamResolver::class,
/*
* Passport Client Credentials Grant
* When set to true the package will use Passports Client to check permissions
*/
'use_passport_client_credentials' => false,
/*
* When set to true, the required permission names are added to exception messages.
* This could be considered an information leak in some contexts, so the default
* setting is false here for optimum safety.
*/
'display_permission_in_exception' => false,
/*
* When set to true, the required role names are added to exception messages.
* This could be considered an information leak in some contexts, so the default
* setting is false here for optimum safety.
*/
'display_role_in_exception' => false,
/*
* By default wildcard permission lookups are disabled.
* See documentation to understand supported syntax.
*/
'enable_wildcard_permission' => false,
/*
* The class to use for interpreting wildcard permissions.
* If you need to modify delimiters, override the class and specify its name here.
*/
// 'permission.wildcard_permission' => Spatie\Permission\WildcardPermission::class,
/* Cache-specific settings */
'cache' => [
/*
* By default all permissions are cached for 24 hours to speed up performance.
* When permissions or roles are updated the cache is flushed automatically.
*/
'expiration_time' => \DateInterval::createFromDateString('24 hours'),
/*
* The cache key used to store all permissions.
*/
'key' => 'spatie.permission.cache',
/*
* You may optionally indicate a specific cache driver to use for permission and
* role caching using any of the `store` drivers listed in the cache.php config
* file. Using 'default' here means to use the `default` set in cache.php.
*/
'store' => 'default',
],
];

112
config/queue.php Normal file
View file

@ -0,0 +1,112 @@
<?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", "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,
],
],
/*
|--------------------------------------------------------------------------
| 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',
],
];

84
config/sanctum.php Normal file
View file

@ -0,0 +1,84 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort(),
// Sanctum::currentRequestHost(),
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
],
];

38
config/services.php Normal file
View file

@ -0,0 +1,38 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, 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' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'resend' => [
'key' => env('RESEND_KEY'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
];

217
config/session.php Normal file
View file

@ -0,0 +1,217 @@
<?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", "apc",
| "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: "apc", "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(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 and all 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),
];

41
config/vite.php Normal file
View file

@ -0,0 +1,41 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Vite Build Paths
|--------------------------------------------------------------------------
|
| Vite build paths are used to determine where the built assets are located.
| This is different per domain.
|
*/
'build_path' => env('VITE_BUILD_PATH', 'build'),
/*
|--------------------------------------------------------------------------
| Dev Server URL
|--------------------------------------------------------------------------
|
| This is the URL that Vite dev server is running on. In development,
| Laravel will load assets from this URL. The URL is dynamically set
| based on the current domain via ThemeServiceProvider.
|
*/
'dev_url' => env('ASSET_URL', env('VITE_DEV_SERVER_URL', 'https://assets.pr-copilot.test')),
/*
|--------------------------------------------------------------------------
| Hot File
|--------------------------------------------------------------------------
|
| The "hot" file is used to determine if the dev server is running.
|
*/
'hot_file' => public_path('hot'),
];

1
database/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.sqlite*

View file

@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View file

@ -0,0 +1,49 @@
<?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('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
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();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};

View file

@ -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->integer('expiration');
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};

View file

@ -0,0 +1,57 @@
<?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->unsignedTinyInteger('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->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};

View file

@ -0,0 +1,42 @@
<?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::table('users', function (Blueprint $table) {
$table->text('two_factor_secret')
->after('password')
->nullable();
$table->text('two_factor_recovery_codes')
->after('two_factor_secret')
->nullable();
$table->timestamp('two_factor_confirmed_at')
->after('two_factor_recovery_codes')
->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn([
'two_factor_secret',
'two_factor_recovery_codes',
'two_factor_confirmed_at',
]);
});
}
};

View file

@ -0,0 +1,33 @@
<?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('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->text('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};

View file

@ -0,0 +1,23 @@
<?php
namespace Database\Seeders;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
}

View file

@ -0,0 +1,79 @@
<?php
namespace Database\Seeders;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
class RolesAndPermissionsSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// Rollen
Role::create(['name' => 'superadmin']);
Role::create(['name' => 'admin']);
Role::create(['name' => 'trader']);
Role::create(['name' => 'customer']);
// Beispiel-Permissions
//Trader
Permission::create(['name' => 'products_manage']);
//Customer
Permission::create(['name' => 'orders_view']);
//Admin
//CMS
Permission::create(['name' => 'cms_manage']);
Permission::create(['name' => 'cms_view']);
Permission::create(['name' => 'cms_create']);
Permission::create(['name' => 'cms_delete']);
Permission::create(['name' => 'cms_list']);
//User
Permission::create(['name' => 'user_edit']);
Permission::create(['name' => 'user_view']);
Permission::create(['name' => 'user_create']);
Permission::create(['name' => 'user_delete']);
Permission::create(['name' => 'user_list']);
//Superadmin
//alles
/*Permission::create(['name' => 'products_manage']);
Permission::create(['name' => 'orders_view']);
Permission::create(['name' => 'user_settings']);
Permission::create(['name' => 'system_settings']);
Permission::create(['name' => 'user_manage']);
Permission::create(['name' => 'order_manage']);
Permission::create(['name' => 'product_manage']);
Permission::create(['name' => 'user_view']);
Permission::create(['name' => 'order_view']);
Permission::create(['name' => 'product_view']);
Permission::create(['name' => 'system_view']);
Permission::create(['name' => 'user_create']);
Permission::create(['name' => 'order_create']);
Permission::create(['name' => 'product_create']);
Permission::create(['name' => 'system_create']);
Permission::create(['name' => 'order_edit']);
Permission::create(['name' => 'product_edit']);
Permission::create(['name' => 'system_edit']);
Permission::create(['name' => 'user_delete']);
Permission::create(['name' => 'order_delete']);
Permission::create(['name' => 'product_delete']);
Permission::create(['name' => 'system_delete']);
Permission::create(['name' => 'user_list']);
Permission::create(['name' => 'order_list']);
Permission::create(['name' => 'product_list']);
Permission::create(['name' => 'system_list']);*/
}
}

46
dev/Models/ApiUser.php Normal file
View file

@ -0,0 +1,46 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class ApiUser
*
* @property int $id
* @property int|null $user_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property SfGuardUser|null $sf_guard_user
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser query()
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ApiUser whereUserId($value)
* @mixin \Eloquent
*/
class ApiUser extends Model
{
protected $table = 'api_user';
protected $casts = [
'user_id' => 'int'
];
protected $fillable = [
'user_id'
];
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
}

35
dev/Models/Blacklist.php Normal file
View file

@ -0,0 +1,35 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class Blacklist
*
* @property int $id
* @property string $title
* @property string $content
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|Blacklist newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Blacklist newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Blacklist query()
* @method static \Illuminate\Database\Eloquent\Builder|Blacklist whereContent($value)
* @method static \Illuminate\Database\Eloquent\Builder|Blacklist whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Blacklist whereTitle($value)
* @mixin \Eloquent
*/
class Blacklist extends Model
{
protected $table = 'blacklist';
public $timestamps = false;
protected $fillable = [
'title',
'content'
];
}

55
dev/Models/Category.php Normal file
View file

@ -0,0 +1,55 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Category
*
* @property int $id
* @property Collection|FooterCode[] $footer_codes
* @property Collection|CategoryTranslation[] $category_translations
* @property Collection|PressRelease[] $press_releases
* @property Collection|PromotionLink[] $promotion_links
* @package App\Models
* @property-read int|null $category_translations_count
* @property-read int|null $footer_codes_count
* @property-read int|null $press_releases_count
* @property-read int|null $promotion_links_count
* @method static \Illuminate\Database\Eloquent\Builder|Category newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Category newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Category query()
* @method static \Illuminate\Database\Eloquent\Builder|Category whereId($value)
* @mixin \Eloquent
*/
class Category extends Model
{
protected $table = 'category';
public $timestamps = false;
public function footer_codes()
{
return $this->belongsToMany(FooterCode::class);
}
public function category_translations()
{
return $this->hasMany(CategoryTranslation::class, 'id');
}
public function press_releases()
{
return $this->hasMany(PressRelease::class);
}
public function promotion_links()
{
return $this->belongsToMany(PromotionLink::class, 'promotion_link_category');
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class CategoryFooterCode
*
* @property int $footer_code_id
* @property int $category_id
* @property Category $category
* @property FooterCode $footer_code
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|CategoryFooterCode newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CategoryFooterCode newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CategoryFooterCode query()
* @method static \Illuminate\Database\Eloquent\Builder|CategoryFooterCode whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CategoryFooterCode whereFooterCodeId($value)
* @mixin \Eloquent
*/
class CategoryFooterCode extends Model
{
protected $table = 'category_footer_code';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'footer_code_id' => 'int',
'category_id' => 'int'
];
protected $fillable = [
'footer_code_id',
'category_id'
];
public function category()
{
return $this->belongsTo(Category::class);
}
public function footer_code()
{
return $this->belongsTo(FooterCode::class);
}
}

View file

@ -0,0 +1,50 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class CategoryTranslation
*
* @property int $id
* @property string $name
* @property string|null $description
* @property string $lang
* @property string|null $slug
* @property Category $category
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation query()
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation whereLang($value)
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|CategoryTranslation whereSlug($value)
* @mixin \Eloquent
*/
class CategoryTranslation extends Model
{
protected $table = 'category_translation';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'id' => 'int'
];
protected $fillable = [
'id',
'description'
];
public function category()
{
return $this->belongsTo(Category::class, 'id');
}
}

137
dev/Models/Company.php Normal file
View file

@ -0,0 +1,137 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Company
*
* @property int $id
* @property string $name
* @property string $address
* @property int $country_id
* @property string $phone
* @property string|null $fax
* @property string $email
* @property string $website
* @property string|null $logo
* @property string $ctype
* @property string|null $login
* @property string|null $password
* @property int|null $is_active
* @property int|null $user_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $slug
* @property int $disable_footer_code
* @property Country $country
* @property SfGuardUser|null $sf_guard_user
* @property CompanyUser $company_user
* @property Collection|Contact[] $contacts
* @property Collection|PressRelease[] $press_releases
* @property ResponsibleCompanyUser $responsible_company_user
* @property Collection|UserPaymentOption[] $user_payment_options
* @package App\Models
* @property-read int|null $contacts_count
* @property-read int|null $press_releases_count
* @property-read int|null $user_payment_options_count
* @method static \Illuminate\Database\Eloquent\Builder|Company newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Company newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Company query()
* @method static \Illuminate\Database\Eloquent\Builder|Company whereAddress($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereCtype($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereDisableFooterCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereFax($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereIsActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereLogin($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereLogo($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company wherePassword($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company wherePhone($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Company whereWebsite($value)
* @mixin \Eloquent
*/
class Company extends Model
{
protected $table = 'company';
protected $casts = [
'country_id' => 'int',
'is_active' => 'int',
'user_id' => 'int',
'disable_footer_code' => 'int'
];
protected $hidden = [
'password'
];
protected $fillable = [
'name',
'address',
'country_id',
'phone',
'fax',
'email',
'website',
'logo',
'ctype',
'login',
'password',
'is_active',
'user_id',
'slug',
'disable_footer_code'
];
public function country()
{
return $this->belongsTo(Country::class);
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
public function company_user()
{
return $this->hasOne(CompanyUser::class);
}
public function contacts()
{
return $this->hasMany(Contact::class);
}
public function press_releases()
{
return $this->hasMany(PressRelease::class);
}
public function responsible_company_user()
{
return $this->hasOne(ResponsibleCompanyUser::class);
}
public function user_payment_options()
{
return $this->belongsToMany(UserPaymentOption::class, 'user_payment_option_company', 'company_id', 'payment_option_id')
->withPivot('ip_address', 'is_active')
->withTimestamps();
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class CompanyUser
*
* @property int $company_id
* @property int $user_id
* @property Company $company
* @property SfGuardUser $sf_guard_user
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|CompanyUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CompanyUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CompanyUser query()
* @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CompanyUser whereUserId($value)
* @mixin \Eloquent
*/
class CompanyUser extends Model
{
protected $table = 'company_user';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'company_id' => 'int',
'user_id' => 'int'
];
protected $fillable = [
'company_id',
'user_id'
];
public function company()
{
return $this->belongsTo(Company::class);
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
}

85
dev/Models/Contact.php Normal file
View file

@ -0,0 +1,85 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Contact
*
* @property int $id
* @property int $company_id
* @property int $salutation_id
* @property string|null $title
* @property string $first_name
* @property string $last_name
* @property string|null $responsibility
* @property string|null $phone
* @property string|null $fax
* @property string $email
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Company $company
* @property Salutation $salutation
* @property Collection|PressRelease[] $press_releases
* @package App\Models
* @property-read int|null $press_releases_count
* @method static \Illuminate\Database\Eloquent\Builder|Contact newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Contact newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Contact query()
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereFax($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereFirstName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereLastName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact wherePhone($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereResponsibility($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereSalutationId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|Contact whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Contact extends Model
{
protected $table = 'contact';
protected $casts = [
'company_id' => 'int',
'salutation_id' => 'int'
];
protected $fillable = [
'company_id',
'salutation_id',
'title',
'first_name',
'last_name',
'responsibility',
'phone',
'fax',
'email'
];
public function company()
{
return $this->belongsTo(Company::class);
}
public function salutation()
{
return $this->belongsTo(Salutation::class);
}
public function press_releases()
{
return $this->belongsToMany(PressRelease::class, 'press_release_contact');
}
}

61
dev/Models/Country.php Normal file
View file

@ -0,0 +1,61 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Country
*
* @property int $id
* @property string $name
* @property Collection|Company[] $companies
* @property Collection|InvoiceBillingAddress[] $invoice_billing_addresses
* @property Collection|SfGuardUserProfile[] $sf_guard_user_profiles
* @property Collection|UserBillingAddress[] $user_billing_addresses
* @package App\Models
* @property-read int|null $companies_count
* @property-read int|null $invoice_billing_addresses_count
* @property-read int|null $sf_guard_user_profiles_count
* @property-read int|null $user_billing_addresses_count
* @method static \Illuminate\Database\Eloquent\Builder|Country newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Country newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Country query()
* @method static \Illuminate\Database\Eloquent\Builder|Country whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Country whereName($value)
* @mixin \Eloquent
*/
class Country extends Model
{
protected $table = 'country';
public $timestamps = false;
protected $fillable = [
'name'
];
public function companies()
{
return $this->hasMany(Company::class);
}
public function invoice_billing_addresses()
{
return $this->hasMany(InvoiceBillingAddress::class);
}
public function sf_guard_user_profiles()
{
return $this->hasMany(SfGuardUserProfile::class);
}
public function user_billing_addresses()
{
return $this->hasMany(UserBillingAddress::class);
}
}

70
dev/Models/Coupon.php Normal file
View file

@ -0,0 +1,70 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Coupon
*
* @property int $id
* @property int $payment_option_id
* @property string $code
* @property float $value
* @property int|null $on_redeem_expire
* @property int|null $is_expired
* @property Carbon|null $valid_until_date
* @property PaymentOption $payment_option
* @property Collection|UserPaymentOption[] $user_payment_options
* @package App\Models
* @property-read int|null $user_payment_options_count
* @method static \Illuminate\Database\Eloquent\Builder|Coupon newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Coupon newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Coupon query()
* @method static \Illuminate\Database\Eloquent\Builder|Coupon whereCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|Coupon whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Coupon whereIsExpired($value)
* @method static \Illuminate\Database\Eloquent\Builder|Coupon whereOnRedeemExpire($value)
* @method static \Illuminate\Database\Eloquent\Builder|Coupon wherePaymentOptionId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Coupon whereValidUntilDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Coupon whereValue($value)
* @mixin \Eloquent
*/
class Coupon extends Model
{
protected $table = 'coupon';
public $timestamps = false;
protected $casts = [
'payment_option_id' => 'int',
'value' => 'float',
'on_redeem_expire' => 'int',
'is_expired' => 'int',
'valid_until_date' => 'datetime'
];
protected $fillable = [
'payment_option_id',
'code',
'value',
'on_redeem_expire',
'is_expired',
'valid_until_date'
];
public function payment_option()
{
return $this->belongsTo(PaymentOption::class);
}
public function user_payment_options()
{
return $this->hasMany(UserPaymentOption::class);
}
}

53
dev/Models/FooterCode.php Normal file
View file

@ -0,0 +1,53 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class FooterCode
*
* @property int $id
* @property string $title
* @property string|null $content
* @property string|null $language
* @property int $is_global
* @property Collection|Category[] $categories
* @package App\Models
* @property-read int|null $categories_count
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode query()
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode whereContent($value)
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode whereIsGlobal($value)
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode whereLanguage($value)
* @method static \Illuminate\Database\Eloquent\Builder|FooterCode whereTitle($value)
* @mixin \Eloquent
*/
class FooterCode extends Model
{
protected $table = 'footer_code';
public $timestamps = false;
protected $casts = [
'is_global' => 'int'
];
protected $fillable = [
'title',
'content',
'language',
'is_global'
];
public function categories()
{
return $this->belongsToMany(Category::class);
}
}

115
dev/Models/Invoice.php Normal file
View file

@ -0,0 +1,115 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class Invoice
*
* @property int $id
* @property int $user_id
* @property int $user_payment_id
* @property int $billing_address_id
* @property string $number
* @property string $status
* @property int|null $reminder_count
* @property Carbon|null $next_reminder_date
* @property float $amount
* @property int|null $is_netto
* @property int $is_media
* @property Carbon $invoice_date
* @property Carbon $due_date
* @property Carbon|null $service_period_begin_date
* @property Carbon|null $service_period_end_date
* @property string|null $payment_method
* @property Carbon|null $pay_date
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property InvoiceBillingAddress $invoice_billing_address
* @property SfGuardUser $sf_guard_user
* @property UserPayment $user_payment
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|Invoice newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Invoice newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Invoice query()
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereAmount($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereBillingAddressId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereDueDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereInvoiceDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereIsMedia($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereIsNetto($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereNextReminderDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereNumber($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePayDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice wherePaymentMethod($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereReminderCount($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereServicePeriodBeginDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereServicePeriodEndDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Invoice whereUserPaymentId($value)
* @mixin \Eloquent
*/
class Invoice extends Model
{
protected $table = 'invoice';
protected $casts = [
'user_id' => 'int',
'user_payment_id' => 'int',
'billing_address_id' => 'int',
'reminder_count' => 'int',
'next_reminder_date' => 'datetime',
'amount' => 'float',
'is_netto' => 'int',
'is_media' => 'int',
'invoice_date' => 'datetime',
'due_date' => 'datetime',
'service_period_begin_date' => 'datetime',
'service_period_end_date' => 'datetime',
'pay_date' => 'datetime'
];
protected $fillable = [
'user_id',
'user_payment_id',
'billing_address_id',
'number',
'status',
'reminder_count',
'next_reminder_date',
'amount',
'is_netto',
'is_media',
'invoice_date',
'due_date',
'service_period_begin_date',
'service_period_end_date',
'payment_method',
'pay_date'
];
public function invoice_billing_address()
{
return $this->belongsTo(InvoiceBillingAddress::class, 'billing_address_id');
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
public function user_payment()
{
return $this->belongsTo(UserPayment::class);
}
}

View file

@ -0,0 +1,88 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class InvoiceBillingAddress
*
* @property int $id
* @property int|null $salutation_id
* @property string|null $title
* @property string $name
* @property string|null $address
* @property string|null $address1
* @property string|null $address2
* @property string|null $postal_code
* @property string|null $city
* @property int|null $country_id
* @property string|null $country_name
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Country|null $country
* @property Salutation|null $salutation
* @property Collection|Invoice[] $invoices
* @package App\Models
* @property-read int|null $invoices_count
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress query()
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereAddress($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereAddress1($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereAddress2($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereCity($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereCountryName($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress wherePostalCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereSalutationId($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|InvoiceBillingAddress whereUpdatedAt($value)
* @mixin \Eloquent
*/
class InvoiceBillingAddress extends Model
{
protected $table = 'invoice_billing_address';
protected $casts = [
'salutation_id' => 'int',
'country_id' => 'int'
];
protected $fillable = [
'salutation_id',
'title',
'name',
'address',
'address1',
'address2',
'postal_code',
'city',
'country_id',
'country_name'
];
public function country()
{
return $this->belongsTo(Country::class);
}
public function salutation()
{
return $this->belongsTo(Salutation::class);
}
public function invoices()
{
return $this->hasMany(Invoice::class, 'billing_address_id');
}
}

View file

@ -0,0 +1,35 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class MigrationVersion
*
* @property int|null $version
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|MigrationVersion newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|MigrationVersion newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|MigrationVersion query()
* @method static \Illuminate\Database\Eloquent\Builder|MigrationVersion whereVersion($value)
* @mixin \Eloquent
*/
class MigrationVersion extends Model
{
protected $table = 'migration_version';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'version' => 'int'
];
protected $fillable = [
'version'
];
}

View file

@ -0,0 +1,83 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class NewsletterSubscription
*
* @property int $id
* @property int $salutation_id
* @property string $first_name
* @property string $last_name
* @property string $email
* @property string|null $ip_address
* @property int|null $is_active
* @property Carbon|null $subscribe_date
* @property Carbon|null $unsubscribe_date
* @property int|null $user_id
* @property string|null $validate
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Salutation $salutation
* @property SfGuardUser|null $sf_guard_user
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription query()
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereFirstName($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereIpAddress($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereIsActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereLastName($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereSalutationId($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereSubscribeDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereUnsubscribeDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|NewsletterSubscription whereValidate($value)
* @mixin \Eloquent
*/
class NewsletterSubscription extends Model
{
protected $table = 'newsletter_subscription';
protected $casts = [
'salutation_id' => 'int',
'is_active' => 'int',
'subscribe_date' => 'datetime',
'unsubscribe_date' => 'datetime',
'user_id' => 'int'
];
protected $fillable = [
'salutation_id',
'first_name',
'last_name',
'email',
'ip_address',
'is_active',
'subscribe_date',
'unsubscribe_date',
'user_id',
'validate'
];
public function salutation()
{
return $this->belongsTo(Salutation::class);
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
}

View file

@ -0,0 +1,92 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class PaymentOption
*
* @property int $id
* @property string $article_number
* @property string $type
* @property float $price
* @property int|null $is_hidden
* @property string|null $event_name_prefix
* @property int|null $activate_on_first_payment
* @property Collection|Coupon[] $coupons
* @property PaymentOptionAccessGroup $payment_option_access_group
* @property PaymentOptionExcludeGroup $payment_option_exclude_group
* @property PaymentOptionReference $payment_option_reference
* @property PaymentOptionTranslation $payment_option_translation
* @property Collection|UserPaymentOption[] $user_payment_options
* @package App\Models
* @property-read int|null $coupons_count
* @property-read int|null $user_payment_options_count
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption query()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereActivateOnFirstPayment($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereArticleNumber($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereEventNamePrefix($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereIsHidden($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption wherePrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereType($value)
* @mixin \Eloquent
*/
class PaymentOption extends Model
{
protected $table = 'payment_option';
public $timestamps = false;
protected $casts = [
'price' => 'float',
'is_hidden' => 'int',
'activate_on_first_payment' => 'int'
];
protected $fillable = [
'article_number',
'type',
'price',
'is_hidden',
'event_name_prefix',
'activate_on_first_payment'
];
public function coupons()
{
return $this->hasMany(Coupon::class);
}
public function payment_option_access_group()
{
return $this->hasOne(PaymentOptionAccessGroup::class);
}
public function payment_option_exclude_group()
{
return $this->hasOne(PaymentOptionExcludeGroup::class);
}
public function payment_option_reference()
{
return $this->hasOne(PaymentOptionReference::class, 'parent_payment_option_id');
}
public function payment_option_translation()
{
return $this->hasOne(PaymentOptionTranslation::class, 'id');
}
public function user_payment_options()
{
return $this->hasMany(UserPaymentOption::class);
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class PaymentOptionAccessGroup
*
* @property int $payment_option_id
* @property int $group_id
* @property SfGuardGroup $sf_guard_group
* @property PaymentOption $payment_option
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionAccessGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionAccessGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionAccessGroup query()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionAccessGroup whereGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionAccessGroup wherePaymentOptionId($value)
* @mixin \Eloquent
*/
class PaymentOptionAccessGroup extends Model
{
protected $table = 'payment_option_access_group';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'payment_option_id' => 'int',
'group_id' => 'int'
];
protected $fillable = [
'payment_option_id',
'group_id'
];
public function sf_guard_group()
{
return $this->belongsTo(SfGuardGroup::class, 'group_id');
}
public function payment_option()
{
return $this->belongsTo(PaymentOption::class);
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class PaymentOptionExcludeGroup
*
* @property int $payment_option_id
* @property int $group_id
* @property SfGuardGroup $sf_guard_group
* @property PaymentOption $payment_option
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionExcludeGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionExcludeGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionExcludeGroup query()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionExcludeGroup whereGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionExcludeGroup wherePaymentOptionId($value)
* @mixin \Eloquent
*/
class PaymentOptionExcludeGroup extends Model
{
protected $table = 'payment_option_exclude_group';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'payment_option_id' => 'int',
'group_id' => 'int'
];
protected $fillable = [
'payment_option_id',
'group_id'
];
public function sf_guard_group()
{
return $this->belongsTo(SfGuardGroup::class, 'group_id');
}
public function payment_option()
{
return $this->belongsTo(PaymentOption::class);
}
}

View file

@ -0,0 +1,45 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class PaymentOptionReference
*
* @property int $parent_payment_option_id
* @property int $child_payment_option_id
* @property PaymentOption $payment_option
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionReference newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionReference newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionReference query()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionReference whereChildPaymentOptionId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionReference whereParentPaymentOptionId($value)
* @mixin \Eloquent
*/
class PaymentOptionReference extends Model
{
protected $table = 'payment_option_reference';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'parent_payment_option_id' => 'int',
'child_payment_option_id' => 'int'
];
protected $fillable = [
'parent_payment_option_id',
'child_payment_option_id'
];
public function payment_option()
{
return $this->belongsTo(PaymentOption::class, 'parent_payment_option_id');
}
}

View file

@ -0,0 +1,50 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class PaymentOptionTranslation
*
* @property int $id
* @property string $name
* @property string|null $description
* @property string $lang
* @property PaymentOption $payment_option
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation query()
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation whereLang($value)
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOptionTranslation whereName($value)
* @mixin \Eloquent
*/
class PaymentOptionTranslation extends Model
{
protected $table = 'payment_option_translation';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'id' => 'int'
];
protected $fillable = [
'id',
'name',
'description',
'lang'
];
public function payment_option()
{
return $this->belongsTo(PaymentOption::class, 'id');
}
}

126
dev/Models/PressRelease.php Normal file
View file

@ -0,0 +1,126 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class PressRelease
*
* @property int $id
* @property string $title
* @property string $language
* @property string $text
* @property string|null $backlink_url
* @property int $category_id
* @property int $user_id
* @property int|null $company_id
* @property int|null $user_payment_id
* @property int|null $payment
* @property string|null $status
* @property int|null $hits
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $slug
* @property int $teaser_begin
* @property int $teaser_end
* @property int $no_export
* @property string|null $keywords
* @property Category $category
* @property Company|null $company
* @property SfGuardUser $sf_guard_user
* @property Collection|Contact[] $contacts
* @property Collection|PressReleaseImageOld[] $press_release_image_olds
* @package App\Models
* @property-read int|null $contacts_count
* @property-read int|null $press_release_image_olds_count
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease query()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereBacklinkUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereHits($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereKeywords($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereLanguage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereNoExport($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease wherePayment($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTeaserBegin($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTeaserEnd($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUserPaymentId($value)
* @mixin \Eloquent
*/
class PressRelease extends Model
{
protected $table = 'press_release';
protected $casts = [
'category_id' => 'int',
'user_id' => 'int',
'company_id' => 'int',
'user_payment_id' => 'int',
'payment' => 'int',
'hits' => 'int',
'teaser_begin' => 'int',
'teaser_end' => 'int',
'no_export' => 'int'
];
protected $fillable = [
'title',
'language',
'text',
'backlink_url',
'category_id',
'user_id',
'company_id',
'user_payment_id',
'payment',
'status',
'hits',
'slug',
'teaser_begin',
'teaser_end',
'no_export',
'keywords'
];
public function category()
{
return $this->belongsTo(Category::class);
}
public function company()
{
return $this->belongsTo(Company::class);
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
public function contacts()
{
return $this->belongsToMany(Contact::class, 'press_release_contact');
}
public function press_release_image_olds()
{
return $this->hasMany(PressReleaseImageOld::class);
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class PressReleaseContact
*
* @property int $press_release_id
* @property int $contact_id
* @property Contact $contact
* @property PressRelease $press_release
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseContact newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseContact newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseContact query()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseContact whereContactId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseContact wherePressReleaseId($value)
* @mixin \Eloquent
*/
class PressReleaseContact extends Model
{
protected $table = 'press_release_contact';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'press_release_id' => 'int',
'contact_id' => 'int'
];
protected $fillable = [
'press_release_id',
'contact_id'
];
public function contact()
{
return $this->belongsTo(Contact::class);
}
public function press_release()
{
return $this->belongsTo(PressRelease::class);
}
}

View file

@ -0,0 +1,59 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class PressReleaseImage
*
* @property int $id
* @property string $title
* @property string $description
* @property string $image
* @property string $copyright
* @property int|null $press_release_id
* @property int|null $is_preview_image
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $slug
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage query()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereCopyright($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereImage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereIsPreviewImage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage wherePressReleaseId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImage whereUpdatedAt($value)
* @mixin \Eloquent
*/
class PressReleaseImage extends Model
{
protected $table = 'press_release_image';
protected $casts = [
'press_release_id' => 'int',
'is_preview_image' => 'int'
];
protected $fillable = [
'title',
'description',
'image',
'copyright',
'press_release_id',
'is_preview_image',
'slug'
];
}

View file

@ -0,0 +1,65 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class PressReleaseImageOld
*
* @property int $id
* @property string $title
* @property string $description
* @property string $image
* @property string $copyright
* @property int|null $press_release_id
* @property int|null $is_preview_image
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $slug
* @property PressRelease|null $press_release
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld query()
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereCopyright($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereImage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereIsPreviewImage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld wherePressReleaseId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressReleaseImageOld whereUpdatedAt($value)
* @mixin \Eloquent
*/
class PressReleaseImageOld extends Model
{
protected $table = 'press_release_image_old';
protected $casts = [
'press_release_id' => 'int',
'is_preview_image' => 'int'
];
protected $fillable = [
'title',
'description',
'image',
'copyright',
'press_release_id',
'is_preview_image',
'slug'
];
public function press_release()
{
return $this->belongsTo(PressRelease::class);
}
}

View file

@ -0,0 +1,57 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class PromotionLink
*
* @property int $id
* @property string $title
* @property string $link
* @property string $language
* @property int|null $show_on_homepage
* @property int|null $press_release_id
* @property Collection|Category[] $categories
* @package App\Models
* @property-read int|null $categories_count
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink query()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereLanguage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereLink($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink wherePressReleaseId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereShowOnHomepage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLink whereTitle($value)
* @mixin \Eloquent
*/
class PromotionLink extends Model
{
protected $table = 'promotion_link';
public $timestamps = false;
protected $casts = [
'show_on_homepage' => 'int',
'press_release_id' => 'int'
];
protected $fillable = [
'title',
'link',
'language',
'show_on_homepage',
'press_release_id'
];
public function categories()
{
return $this->belongsToMany(Category::class, 'promotion_link_category');
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class PromotionLinkCategory
*
* @property int $promotion_link_id
* @property int $category_id
* @property Category $category
* @property PromotionLink $promotion_link
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLinkCategory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLinkCategory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLinkCategory query()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLinkCategory whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionLinkCategory wherePromotionLinkId($value)
* @mixin \Eloquent
*/
class PromotionLinkCategory extends Model
{
protected $table = 'promotion_link_category';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'promotion_link_id' => 'int',
'category_id' => 'int'
];
protected $fillable = [
'promotion_link_id',
'category_id'
];
public function category()
{
return $this->belongsTo(Category::class);
}
public function promotion_link()
{
return $this->belongsTo(PromotionLink::class);
}
}

View file

@ -0,0 +1,51 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class ResponsibleCompanyUser
*
* @property int $company_id
* @property int $user_id
* @property Company $company
* @property SfGuardUser $sf_guard_user
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|ResponsibleCompanyUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ResponsibleCompanyUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ResponsibleCompanyUser query()
* @method static \Illuminate\Database\Eloquent\Builder|ResponsibleCompanyUser whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ResponsibleCompanyUser whereUserId($value)
* @mixin \Eloquent
*/
class ResponsibleCompanyUser extends Model
{
protected $table = 'responsible_company_user';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'company_id' => 'int',
'user_id' => 'int'
];
protected $fillable = [
'company_id',
'user_id'
];
public function company()
{
return $this->belongsTo(Company::class);
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
}

68
dev/Models/Salutation.php Normal file
View file

@ -0,0 +1,68 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Salutation
*
* @property int $id
* @property Collection|Contact[] $contacts
* @property Collection|InvoiceBillingAddress[] $invoice_billing_addresses
* @property Collection|NewsletterSubscription[] $newsletter_subscriptions
* @property SalutationTranslation $salutation_translation
* @property Collection|SfGuardUserProfile[] $sf_guard_user_profiles
* @property Collection|UserBillingAddress[] $user_billing_addresses
* @package App\Models
* @property-read int|null $contacts_count
* @property-read int|null $invoice_billing_addresses_count
* @property-read int|null $newsletter_subscriptions_count
* @property-read int|null $sf_guard_user_profiles_count
* @property-read int|null $user_billing_addresses_count
* @method static \Illuminate\Database\Eloquent\Builder|Salutation newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Salutation newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Salutation query()
* @method static \Illuminate\Database\Eloquent\Builder|Salutation whereId($value)
* @mixin \Eloquent
*/
class Salutation extends Model
{
protected $table = 'salutation';
public $timestamps = false;
public function contacts()
{
return $this->hasMany(Contact::class);
}
public function invoice_billing_addresses()
{
return $this->hasMany(InvoiceBillingAddress::class);
}
public function newsletter_subscriptions()
{
return $this->hasMany(NewsletterSubscription::class);
}
public function salutation_translation()
{
return $this->hasOne(SalutationTranslation::class, 'id');
}
public function sf_guard_user_profiles()
{
return $this->hasMany(SfGuardUserProfile::class);
}
public function user_billing_addresses()
{
return $this->hasMany(UserBillingAddress::class);
}
}

View file

@ -0,0 +1,47 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class SalutationTranslation
*
* @property int $id
* @property string $name
* @property string $lang
* @property Salutation $salutation
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|SalutationTranslation newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SalutationTranslation newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SalutationTranslation query()
* @method static \Illuminate\Database\Eloquent\Builder|SalutationTranslation whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SalutationTranslation whereLang($value)
* @method static \Illuminate\Database\Eloquent\Builder|SalutationTranslation whereName($value)
* @mixin \Eloquent
*/
class SalutationTranslation extends Model
{
protected $table = 'salutation_translation';
public $incrementing = false;
public $timestamps = false;
protected $casts = [
'id' => 'int'
];
protected $fillable = [
'id',
'name',
'lang'
];
public function salutation()
{
return $this->belongsTo(Salutation::class, 'id');
}
}

View file

@ -0,0 +1,63 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class SfGuardGroup
*
* @property int $id
* @property string|null $name
* @property string|null $description
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property PaymentOptionAccessGroup $payment_option_access_group
* @property PaymentOptionExcludeGroup $payment_option_exclude_group
* @property SfGuardGroupPermission $sf_guard_group_permission
* @property SfGuardUserGroup $sf_guard_user_group
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup query()
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroup whereUpdatedAt($value)
* @mixin \Eloquent
*/
class SfGuardGroup extends Model
{
protected $table = 'sf_guard_group';
protected $fillable = [
'name',
'description'
];
public function payment_option_access_group()
{
return $this->hasOne(PaymentOptionAccessGroup::class, 'group_id');
}
public function payment_option_exclude_group()
{
return $this->hasOne(PaymentOptionExcludeGroup::class, 'group_id');
}
public function sf_guard_group_permission()
{
return $this->hasOne(SfGuardGroupPermission::class, 'group_id');
}
public function sf_guard_user_group()
{
return $this->hasOne(SfGuardUserGroup::class, 'group_id');
}
}

View file

@ -0,0 +1,55 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class SfGuardGroupPermission
*
* @property int $group_id
* @property int $permission_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property SfGuardGroup $sf_guard_group
* @property SfGuardPermission $sf_guard_permission
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission query()
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission whereGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission wherePermissionId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SfGuardGroupPermission whereUpdatedAt($value)
* @mixin \Eloquent
*/
class SfGuardGroupPermission extends Model
{
protected $table = 'sf_guard_group_permission';
public $incrementing = false;
protected $casts = [
'group_id' => 'int',
'permission_id' => 'int'
];
protected $fillable = [
'group_id',
'permission_id'
];
public function sf_guard_group()
{
return $this->belongsTo(SfGuardGroup::class, 'group_id');
}
public function sf_guard_permission()
{
return $this->belongsTo(SfGuardPermission::class, 'permission_id');
}
}

Some files were not shown because too many files have changed in this diff Show more