Based on the question description, it seems like you need to create a new table to store the details of each visit made by a driver for a particular car. Here's an example schema for the new table:
visits
- id (primary key)
- car_id (foreign key to cars table)
- detail_name (string)
- detail_link (boolean)
- detail_description (text)
- driver_name (string)
- manager_id (foreign key to managers table)
- visitor_id (foreign key to visitors table)
- supervisor_id (foreign key to supervisors table)
- created_at (timestamp)
You can then use Laravel's Eloquent ORM to define relationships between the tables and retrieve the data as needed. Here's an example of how you can retrieve all visits for a particular car:
// In Car model
public function visits()
{
return $this->hasMany(Visit::class);
}
// In controller
$car = Car::find($carId);
$visits = $car->visits;
You can then loop through the $visits variable in your view to display the data in a table.