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:
isaacclad
2026-06-11 07:05:41 +00:00
co-authored by Claude Opus 4.8
parent 40bfae6fb6
commit 92fddf0392
4 changed files with 177 additions and 3 deletions
@@ -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');
}
}
+43
View File
@@ -0,0 +1,43 @@
<?php
return [
'slug' => 'transfer',
'name' => 'Transfer',
'logo' => 'images/logo/ladilltransfer-logo.svg',
'icon' => 'transfer.svg',
'tagline' => 'Send and receive files securely',
'headline' => 'Large file sharing, simplified',
'accent' => 'secure links and tracked downloads',
'description' => 'Transfer lets you send large files with password-protected links, expiry dates, and download tracking — no email attachment limits.',
'benefits' =>
[
0 =>
[
'title' => 'Big files, small hassle',
'text' => 'Share files too large for email with a simple link.',
,]
1 =>
[
'title' => 'Access controls',
'text' => 'Set passwords, expiry, and download limits.',
,]
2 =>
[
'title' => 'Delivery tracking',
'text' => 'Know when your files are opened and downloaded.',
,]
,]
'use_cases' =>
[
0 => 'Client deliverables',
1 => 'Media & design files',
2 => 'Internal document sharing',
,]
'gradient_from' => '#0ea5e9',
'gradient_to' => '#4f46e5',
'dashboard_route' => 'transfer.dashboard',
'platform_url' => 'https://localhost',
'marketing_url' => 'https://localhost/products/transfer',
'register_url' => 'https://auth.localhost/register',
'landing_variant' => 'default',
];
+101
View File
@@ -0,0 +1,101 @@
@php
$landing = (array) config('product_landing');
$logo = (string) ($landing['logo'] ?? '');
$logoPath = $logo !== '' ? public_path($logo) : null;
$platformUrl = (string) ($landing['platform_url'] ?? 'https://ladill.com');
$marketingUrl = (string) ($landing['marketing_url'] ?? $platformUrl);
$signInUrl = route('sso.connect', [
'redirect' => route($landing['dashboard_route'] ?? 'login'),
'interactive' => 1,
]);
$variant = (string) ($landing['landing_variant'] ?? 'default');
@endphp
<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>{{ $landing['name'] ?? config('app.name') }} Ladill</title>
<meta name="description" content="{{ $landing['description'] ?? '' }}">
@include('partials.favicon')
<link rel="canonical" href="{{ $marketingUrl }}">
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600,700&display=swap" rel="stylesheet" />
@vite(['resources/css/app.css'])
</head>
<body class="min-h-screen bg-slate-950 font-sans text-white antialiased">
<div class="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(28,117,188,.35),transparent_50%),radial-gradient(circle_at_bottom_right,rgba(217,236,103,.12),transparent_45%)]"></div>
<header class="relative z-10 border-b border-white/10">
<div class="mx-auto flex max-w-6xl items-center justify-between gap-4 px-4 py-4 sm:px-6">
@if ($logo !== '')
<img src="{{ asset($logo) }}?v={{ $logoPath && is_file($logoPath) ? filemtime($logoPath) : '1' }}"
alt="{{ $landing['name'] ?? config('app.name') }}"
class="h-7 w-auto">
@else
<span class="text-sm font-semibold">{{ $landing['name'] ?? config('app.name') }}</span>
@endif
<div class="flex items-center gap-2">
<a href="{{ $platformUrl }}" class="hidden rounded-lg px-3 py-2 text-sm font-medium text-slate-300 transition hover:text-white sm:inline-flex">ladill.com</a>
<a href="{{ $signInUrl }}" class="rounded-lg border border-white/20 px-4 py-2 text-sm font-semibold text-white transition hover:bg-white/10">Sign in</a>
</div>
</div>
</header>
<main class="relative z-10 mx-auto max-w-6xl px-4 py-12 sm:px-6 sm:py-16">
<div class="grid items-center gap-12 lg:grid-cols-2">
<div>
<p class="text-sm font-semibold uppercase tracking-wider text-[#d9ec67]">{{ $landing['tagline'] ?? '' }}</p>
<h1 class="mt-4 text-4xl font-bold tracking-tight sm:text-5xl">{{ $landing['headline'] ?? ($landing['name'] ?? '') }}</h1>
<p class="mt-5 text-base leading-relaxed text-slate-300 sm:text-lg">{{ $landing['description'] ?? '' }}</p>
<div class="mt-8 flex flex-wrap gap-3">
<a href="{{ $signInUrl }}" class="inline-flex items-center justify-center rounded-xl bg-[#d9ec67] px-6 py-3.5 text-sm font-bold text-slate-950 transition hover:bg-[#e5f278]">
{{ $variant === 'webmail' ? 'Sign in to webmail' : 'Get started' }}
</a>
@if ($variant === 'webmail')
<a href="{{ route('webmail.login.manual') }}" class="inline-flex items-center justify-center rounded-xl border border-white/20 px-6 py-3.5 text-sm font-semibold text-white transition hover:bg-white/10">
Manual login
</a>
@else
<a href="{{ $landing['register_url'] ?? $platformUrl.'/register' }}" class="inline-flex items-center justify-center rounded-xl border border-white/20 px-6 py-3.5 text-sm font-semibold text-white transition hover:bg-white/10">
Create account
</a>
@endif
</div>
<p class="mt-5 text-sm text-slate-400">
<a href="{{ $marketingUrl }}" class="font-medium text-slate-200 underline decoration-white/20 underline-offset-2 hover:text-white">Learn more on ladill.com</a>
</p>
</div>
<div class="rounded-3xl border border-white/10 bg-white/5 p-6 backdrop-blur sm:p-8">
<p class="text-xs font-semibold uppercase tracking-wider text-slate-400">Why {{ $landing['name'] ?? 'Ladill' }}</p>
<div class="mt-5 space-y-4">
@foreach (($landing['benefits'] ?? []) as $benefit)
<div class="rounded-2xl border border-white/10 bg-slate-950/40 p-4">
<h2 class="text-sm font-semibold text-white">{{ $benefit['title'] }}</h2>
<p class="mt-1.5 text-sm leading-relaxed text-slate-400">{{ $benefit['text'] }}</p>
</div>
@endforeach
</div>
@if (! empty($landing['use_cases']))
<div class="mt-6 border-t border-white/10 pt-6">
<p class="text-xs font-semibold uppercase tracking-wider text-slate-400">Ideal for</p>
<div class="mt-3 flex flex-wrap gap-2">
@foreach ($landing['use_cases'] as $useCase)
<span class="rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs font-medium text-slate-200">{{ $useCase }}</span>
@endforeach
</div>
</div>
@endif
</div>
</div>
</main>
<footer class="relative z-10 border-t border-white/10 py-6 text-center text-xs text-slate-500">
Part of the <a href="{{ $platformUrl }}" class="font-medium text-slate-300 hover:text-white">Ladill</a> platform one account for every app.
</footer>
</body>
</html>
+2 -3
View File
@@ -1,5 +1,6 @@
<?php
use App\Http\Controllers\ProductLandingController;
use App\Http\Controllers\Auth\SsoLoginController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\Public\QrScanController;
@@ -15,9 +16,7 @@ use App\Http\Controllers\Transfer\OverviewController;
use App\Http\Controllers\Transfer\TransferController;
use Illuminate\Support\Facades\Route;
Route::get('/', fn () => auth()->check()
? redirect()->route('transfer.dashboard')
: redirect()->route('sso.connect'))->name('transfer.root');
Route::get('/', [ProductLandingController::class, 'show'])->name('transfer.landing');
Route::get('/login', [SsoLoginController::class, 'connect'])->name('login');
Route::get('/sso/connect', [SsoLoginController::class, 'connect'])->name('sso.connect');