<?php

namespace App\Http\Controllers;
use App\Models\Form_submitted;

use Illuminate\Http\Request;

class TimelineController extends Controller
{
    public function viewFormTimeline($id)
{
    // Find the submitted form by ID
    $submittedForm = Form_submitted::with(['form_status_log' => function ($query) {
        $query->orderBy('created_at');
    }])->findOrFail($id);

    // Pass the form and its status history to the view
    return view('timeline.timeline', compact('submittedForm'));
}

}
