Deploy Ladill Link / deploy (push) Successful in 29s
Sync QR and storefront short codes from sibling apps via a platform catalog API so My Links shows every ladl.link URL in one place. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
867 B
PHP
35 lines
867 B
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(),
|
|
]);
|
|
}
|
|
}
|