Deploy Ladill Link / deploy (push) Successful in 1m55s
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.
37 lines
1.0 KiB
PHP
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(),
|
|
]);
|
|
}
|
|
}
|