Files
ladill-link/app/Http/Controllers/Link/OverviewController.php
T
isaacclad d45f4b5c58
Deploy Ladill Link / deploy (push) Successful in 1m55s
Make Ladill Link short URLs fully dynamic at click time.
Forward query strings and path suffixes to the live destination, resolve public hosts from config/custom domains instead of hardcoding ladl.link, and keep proxy Location rewrites on the visitor host.
2026-07-16 20:05:43 +00:00

37 lines
1.0 KiB
PHP

<?php
namespace App\Http\Controllers\Link;
use App\Http\Controllers\Controller;
use App\Models\ShortLink;
use App\Services\Link\LinkCatalogSyncService;
use Illuminate\View\View;
class OverviewController extends Controller
{
public function __construct(
private LinkCatalogSyncService $catalogSync,
) {}
public function index(): View
{
$account = ladill_account();
$this->catalogSync->syncForUser($account);
$wallet = $account->getOrCreateLinkWallet();
$recentLinks = ShortLink::query()
->where('user_id', $account->id)
->latest()
->limit(5)
->get();
return view('links.dashboard', [
'wallet' => $wallet,
'recentLinks' => $recentLinks,
'pricePerLink' => \App\Models\LinkWallet::pricePerLink(),
'publicHost' => parse_url($account->publicLinkBaseUrl(), PHP_URL_HOST) ?: ShortLink::publicHost(),
'publicBaseUrl' => $account->publicLinkBaseUrl(),
]);
}
}