Hello guys! Thanks for the interest!
I have a question. My database has a field called "status" setted to type "char".
In my model was defined an Assessor for the "status" field:
public function getStatusAttribute($value)
{
switch($value):
case 'APR': return 'Approved'; break;
case 'DND': return 'Denied'; break;
case 'PND': return 'Pending'; break;
default: return 'Not Defined'; break;
endswitch;
}
I have an edit form developed in Blade Template Engine. Here is my select field:
<div class="row">
<div class="col-md-12 form-group">
{!! Form::label('status', 'Status', ['class' => 'control-label']) !!}
{!! Form::select('status', [
'' => 'Please, select',
'APR' => 'Approved',
'DND' => 'Denied',
'PND' => 'Pending',
], null, ['class' => 'form-control', 'required' => 'required']) !!}
</div>
</div>
The problem is: When receiving a register from my database, the isn't setting the attribute "selected" to the current register that I call. For example, let's assume that I have a register with "status" setted to "DND". When I enter in my edit form, I want to my application automatically sets the to "Denied". I'm doing something wrong?
Thank you very much!