zack tim
asked on
How to access property from model and display it in view
Hello Experts
I need to access the mode payment to display "Cash" for example in index.blade.php instead of "by_cash" in vouchersAccountings blade
My model:
public const PAYMENT_MODE_SELECT = [
'by_cash' => 'Cash',
'by_cc' => 'Credit Card',
'by_chechk' => 'Check',
'by_wire' => 'Wire Transfer',
];
@foreach($Reports as $Report)
<tr>
<th> {{$Report->id}} </th>
<th> {{$Report->client_name}} </th>
<th> {{$Report->hotel_name->hotel_name}} </th>
<th> {{$Report->arrivaldate}} </th>
<th> {{$Report->departuredate}} </th>
<th> {{$Report->night}} </th>
<th> {{$Report->number_of_room}}</th>
<th> {{$Report->payment_mode}}</th>
<th> {{$Report->total_amount}}</th>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.