I have a system where I need to list an arbitrary amount of employees with a textfield for each day of the week where an \"hours worked\" value can be entered.
So I need
I've never used the Laravel framework, but in general I do this in PHP:
foreach ($employee as $key=>$e) {
echo '';
}
This way you will have an array of hours values in the POST, and you can reference the corresponding field by id if you need to. The first field will have id="hours_1", etc. Alternately, if you don't want to use the $key from the query, you can do this:
$cntr = 1;
foreach ($employee as $e) {
echo '';
$cntr++;
}
When you capture the values in the POST, you will have an array of values in $_POST['hours']
. Remember that it is a zero based array, but you can use a foreach loop to iterate through the values.