"
>> Get-Content -Raw routes\web.php
===== LEADS INDEX =====
import { Head, Link, router } from '@inertiajs/react'; import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'; import { DataTable, Pagination, SearchFilters } from '@/Components/ui/DataTable'; import { Button } from '@/Components/ui/Button';
export default function Index({leads,sources,users,filters}:any){ const set=(e:any)=>router.get('/leads',{...filters,[e.target.name]:e.target.value},{preserveState:true,replace:true}); return Lead management
Track sales work from first contact to Operations intake.
>}>
| Lead | Stage | Owner | Next follow-up |
{leads.data.length?leads.data.map((lead:any)=>| {lead.reference} {lead.name} | {lead.stage.replaceAll('_',' ')} | {lead.assigned_to?.name||'Unassigned'} | {lead.next_follow_up_at?new Date(lead.next_follow_up_at).toLocaleString():'—'} |
):| No leads match these filters. |
} }
===== LEADS PIPELINE =====
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
import { Badge, Card } from '@/Components/ui/Feedback';
import { Head, Link, router } from '@inertiajs/react';
const stageLabels: Record = {
new: 'New',
assigned: 'Assigned',
contacted: 'Contacted',
qualification: 'Qualification',
requirement_collection: 'Requirement Collection',
proposal_preparation: 'Proposal Preparation',
proposal_shared: 'Proposal Shared',
negotiation: 'Negotiation',
won: 'Won',
lost: 'Lost',
nurture: 'Nurture',
};
export default function Pipeline({ board, stages }: any) {
const stageMove = (leadId: number, stage: string) => router.patch(`/leads/${leadId}/pipeline`, { stage });
return (
Sales pipeline
Controlled movement across the active lead board.
}
>
{stages.map((stage: string) => (
{stageLabels[stage] || stage.replaceAll('_', ' ')}
{board[stage]?.length ?? 0}
{board[stage]?.map((lead: any) => {
const overdue = lead.next_follow_up_at && new Date(lead.next_follow_up_at) < new Date();
return (
{lead.reference}
{lead.name}
{lead.priority}
{lead.assigned_to?.name || 'Unassigned'} · {lead.source?.name || 'No source'}
Service: {lead.services?.[0]?.name || '—'}
Follow-up: {lead.next_follow_up_at ? new Date(lead.next_follow_up_at).toLocaleString() : 'None'}
{overdue &&
Overdue follow-up
}
Open
);
})}
))}
Use the lead detail view for validated stage movement when a transition needs a reason or handover context.
);
}
===== ROUTES =====
Not Found