Initial Ladill Transfer app — file sharing with QR links.

Scaffolded from the Ladill mini/events extraction pattern: multi-file transfers,
retention controls, public landing pages, analytics, and Gitea deploy workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-08 09:25:30 +00:00
co-authored by Cursor
commit c1e3d8b3ac
281 changed files with 36051 additions and 0 deletions
@@ -0,0 +1,46 @@
<?php
namespace App\Http\Controllers\Transfer;
use App\Http\Controllers\Controller;
use App\Models\Transfer;
use App\Models\TransferDownloadEvent;
use Illuminate\Http\Request;
use Illuminate\View\View;
class AnalyticsController extends Controller
{
public function index(Request $request): View
{
$account = ladill_account();
$transferIds = Transfer::query()
->where('user_id', $account->id)
->pluck('id');
$downloads30d = TransferDownloadEvent::query()
->whereIn('transfer_id', $transferIds)
->where('downloaded_at', '>=', now()->subDays(30))
->count();
$topTransfers = Transfer::query()
->where('user_id', $account->id)
->where('status', Transfer::STATUS_ACTIVE)
->orderByDesc('downloads_total')
->limit(10)
->get();
$recentDownloads = TransferDownloadEvent::query()
->whereIn('transfer_id', $transferIds)
->with(['transfer', 'file'])
->latest('downloaded_at')
->limit(20)
->get();
return view('transfer.analytics.index', [
'downloads30d' => $downloads30d,
'topTransfers' => $topTransfers,
'recentDownloads' => $recentDownloads,
]);
}
}