0
How would you keep one radio input selected in my view, I have the following codes:
View:
<div class="col-md-3">
<div class="form-group">
<label>Tipo de Conta</label>
<input type="radio" name="tipo" value="CC"> Conta Corrente
<input type="radio" name="tipo" value="CP"> Conta Poupança
</div>
</div>
Controller:
public function edit($id_conta_bancaria) {
$bancos = Banco::orderBy('nome')->get();
$conta = ContaBancaria::find($id_conta_bancaria);
return view('conta_bancaria.edit')->with(['conta' => $conta, 'bancos' => $bancos]);
}
Model:
namespace App;
use Illuminate\Database\Eloquent\Model;
class ContaBancaria extends Model
{
protected $dates = ['deleted_at'];
protected $table = 'conta_bancaria';
protected $primaryKey = 'id_conta_bancaria';
protected $fillable = ['id_banco', 'agencia', 'conta', 'tipo', 'operacao'];
}
Sorry John I think I did not elaborate my question well, what I really want is to return with the field marked when editing the "Account Type"
– geekcom
@geekcom you always have to be very specific in your question, to avoid situations like this. Please, as soon as you can, edit your question by adding details, but just be careful not to invalidate the answers already given.
– Wallace Maxters
@geekcom made the edit so that my answer is correct, regardless of anything, always put the next question broadly, because, your question gives to understand the receipt and not the creation.
– user46523