How would I keep a input radio 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'];
}