Add public product landing page at /
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>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
53554bd07f
commit
dc78588653
@@ -0,0 +1,31 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user