I always send data from view like this ->with(array('message'=>'there is an error ')), and it works.
I want to allow the customer to edit some information, so when he/she clicks on the the edit like, this function in a controller is being executed:
public function edit($id)
{
$waitingTimes = WaitingTimes::find($id);
return View::make('waitingtimes.edit')->with(array(
'verticalMenu' => 'none',
'verticalMenuTab' => 'none',
'data' => $waitingTimes
));
}
So later in the view, I should be able to say this:
$data->startTime, $data->endTime, $data->id, $data->restaurant_id
but every time I do that, I got $data->startTime printed on the browser, but I should have got the value of the startTime attribute.
This is my view:
<div class="oneInfo">
{{ Form::text('startTime', '', array('class' => 'time ui-timepicker-input', 'id' => 'startTime', 'autocomplete' => 'off'))}}
<span class="errorMessage">
<?php
echo $errors->first('startTime');
?>
</span>
</div>
The view has an input text and I want that input text to be filled with the data that has been sent from the controller.
how could I do that please?
$data->startTimein the second parameter, I got the data filled, many thanks type an answer to accept it please