86 lines
2.7 KiB
PHP
86 lines
2.7 KiB
PHP
<?php
|
|
|
|
use App\Mail\PartnerInvitationMail;
|
|
use App\Models\PartnerInvitation;
|
|
use App\Models\User;
|
|
use App\Notifications\CustomResetPasswordNotification;
|
|
use App\Notifications\CustomVerifyEmailNotification;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Livewire\Volt\Volt;
|
|
|
|
// Test-Route für Login-Komponente
|
|
Route::get('/test-login', function () {
|
|
return Volt::mount('test-login');
|
|
})->name('test.login');
|
|
|
|
// Vereinfachte Login-Komponente ohne Flux
|
|
Route::get('/login-simple', function () {
|
|
return Volt::mount('auth.login-simple');
|
|
})->name('login.simple');
|
|
|
|
// Debug-Komponente
|
|
Route::get('/debug-login', function () {
|
|
return Volt::mount('debug-login');
|
|
})->name('debug.login');
|
|
|
|
// Einfache Test-Route ohne Volt
|
|
Route::get('/simple-test', function () {
|
|
return view('test-simple');
|
|
})->name('simple.test');
|
|
|
|
// E-Mail-Vorschau-Routen (nur für Entwicklung)
|
|
Route::prefix('test/emails')->group(function () {
|
|
// Partner-Einladung Vorschau
|
|
Route::get('/partner-invitation', function () {
|
|
$invitation = PartnerInvitation::first() ?? new PartnerInvitation([
|
|
'company_name' => 'Musterfirma GmbH',
|
|
'contact_first_name' => 'Max',
|
|
'contact_last_name' => 'Mustermann',
|
|
'email' => 'max@musterfirma.de',
|
|
'expires_at' => now()->addWeeks(2),
|
|
]);
|
|
|
|
// Mock role if not exists
|
|
if (!$invitation->role) {
|
|
$invitation->setRelation('role', (object)[
|
|
'display_name' => 'Premium Partner',
|
|
'name' => 'partner'
|
|
]);
|
|
}
|
|
|
|
$invitationUrl = 'https://portal.b2in.test/partner/invitation/accept/ABC123';
|
|
|
|
return new PartnerInvitationMail($invitation, $invitationUrl);
|
|
})->name('test.email.partner-invitation');
|
|
|
|
// Passwort-Reset Vorschau
|
|
Route::get('/password-reset', function () {
|
|
$user = User::first() ?? new User([
|
|
'name' => 'Max Mustermann',
|
|
'email' => 'max@example.com'
|
|
]);
|
|
|
|
$notification = new CustomResetPasswordNotification('test-token-123');
|
|
$mailMessage = $notification->toMail($user);
|
|
|
|
return $mailMessage->render();
|
|
})->name('test.email.password-reset');
|
|
|
|
// E-Mail-Verifizierung Vorschau
|
|
Route::get('/email-verification', function () {
|
|
$user = User::first() ?? new User([
|
|
'name' => 'Max Mustermann',
|
|
'email' => 'max@example.com'
|
|
]);
|
|
|
|
$notification = new CustomVerifyEmailNotification();
|
|
$mailMessage = $notification->toMail($user);
|
|
|
|
return $mailMessage->render();
|
|
})->name('test.email.verification');
|
|
|
|
// Übersicht aller E-Mail-Vorlagen
|
|
Route::get('/', function () {
|
|
return view('emails.test-overview');
|
|
})->name('test.emails');
|
|
});
|