Serve a marketing landing page at the site root via ProductLandingController instead of redirecting straight to login, with config/product_landing.php and product views. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
826 B
PHP
32 lines
826 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\View\View;
|
|
|
|
class ProductLandingController extends Controller
|
|
{
|
|
public function show(Request $request): View|RedirectResponse
|
|
{
|
|
$landing = config('product_landing', []);
|
|
$variant = (string) ($landing['landing_variant'] ?? 'default');
|
|
$dashboardRoute = (string) ($landing['dashboard_route'] ?? 'login');
|
|
|
|
if ($variant === 'webmail') {
|
|
if ($request->session()->has('mb.email')) {
|
|
return redirect()->route($dashboardRoute);
|
|
}
|
|
|
|
return view('product.landing');
|
|
}
|
|
|
|
if (auth()->check()) {
|
|
return redirect()->route($dashboardRoute);
|
|
}
|
|
|
|
return view('product.landing');
|
|
}
|
|
}
|