get(); $formId = $request->query('form_id'); $query = Lead::with('form')->latest(); if ($formId) { $query->where('form_id', $formId); } $leads = $query->paginate(30)->withQueryString(); return view('admin.leads.index', compact('leads', 'forms', 'formId')); } public function show(Lead $lead): View { $lead->markAsRead(); return view('admin.leads.show', compact('lead')); } public function destroy(Lead $lead): RedirectResponse { $lead->delete(); return redirect()->route('admin.leads.index')->with('success', 'Заявка удалена.'); } }