I'm new at laravel 5.5 (just a few weeks) I have a question and it all starts with an sql query inside the InstitucionController ...
public function show($id)
{
$caso_estudio = CasoEstudio::find($id);
$institucion = Institucion::find($id);
$aux_id = $id;
$sql_ce_id = "select * from casos_estudios
left join instituciones ON institucion_id = instituciones.id
where institucion_id = '$aux_id'";
DB::select($sql_ce_id);
$ce_id = DB::select($sql_ce_id);
$caso_e = (object)$ce_id;
// dd($ce_id);
// dd($caso_e);
// dd($institucion);
return view('instituciones/show', compact('institucion','caso_estudio','caso_e','ce_id'));
}
If they are fixed I have three dd comets, because I need the data to be shown as in the dd ($ institution) ...
Institucion {#204 ▼
#table: "instituciones"
#fillable: array:13 [▶]
#connection: "pgsql"
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#attributes: array:16 [▶]
#original: array:16 [▶]
#changes: []
#casts: []
#dates: []
#dateFormat: null
#appends: []
#dispatchesEvents: []
#observables: []
#relations: []
#touches: []
+timestamps: true
#hidden: []
#visible: []
#guarded: array:1 [▶]
}
with dd ($ ce_id) ...
array:1 [▼
0 => {#202 ▼
+"id": 1
+"institucion_id": 1
+"fec_envio": "1"
+"fec_respuesta": null
+"num_entrega": null
+"num_oficio_siss": null
+"num_exp_supervision": null
+"cot_tesoro": false
+"cot_banavih": false
+"cot_ivss": false
+"aport_trabajador": null
+"aport_patron": null
+"fijos_act": null
+"contratados_act": null
+"otros_act": null
+"jubiladas": null
+"jubilados": null
+"jubilados_bs_anual": null
+"pensionadas_i": null
+"pensionados_i": null
+"pensionados_i_bs_anual": null
+"pensionadas_s": null
+"pensionados_s": null
+"pensionados_s_bs_anual": null
+"observaciones": null
+"created_at": null
+"updated_at": null
+"estado_id": null
+"municipio_id": null
+"parroquia_id": null
+"status": true
+"acronimo": ""
+"nom": "ALCALDÍA DEL MUNICIPIO CARIPE ESTADO MONAGAS"
+"rif": "200067667"
+"naturaleza": ""
+"email": "ALCALDÍA1"
+"tlf1": "2925451638"
+"tlf2": "4166853121"
+"tlf3": "4166853181"
+"direccion": "AV. ENRIQUE CATTUMER. EDIFICIO ALCALDÍA. MUNICIPIO CARIPE. EDO. MONAGAS"
}
]
and finally dd ($ case_e);
{#203 ▼
+"0": {#202 ▼
+"id": 1
+"institucion_id": 1
+"fec_envio": "1"
+"fec_respuesta": null
+"num_entrega": null
+"num_oficio_siss": null
+"num_exp_supervision": null
+"cot_tesoro": false
+"cot_banavih": false
+"cot_ivss": false
+"aport_trabajador": null
+"aport_patron": null
+"fijos_act": null
+"contratados_act": null
+"otros_act": null
+"jubiladas": null
+"jubilados": null
+"jubilados_bs_anual": null
+"pensionadas_i": null
+"pensionados_i": null
+"pensionados_i_bs_anual": null
+"pensionadas_s": null
+"pensionados_s": null
+"pensionados_s_bs_anual": null
+"observaciones": null
+"created_at": null
+"updated_at": null
+"estado_id": null
+"municipio_id": null
+"parroquia_id": null
+"status": true
+"acronimo": ""
+"nom": "ALCALDÍA DEL MUNICIPIO CARIPE ESTADO MONAGAS"
+"rif": "200067667"
+"naturaleza": ""
+"email": "ALCALDÍA1"
+"tlf1": "2925451638"
+"tlf2": "4166853121"
+"tlf3": "4166853181"
+"direccion": "AV. ENRIQUE CATTUMER. EDIFICIO ALCALDÍA. MUNICIPIO CARIPE. EDO. MONAGAS"
}
}
eye I am aware that I have conceptual flaws, but I am learning about the progress, and as I commented at the beginning I need these variables $ ce_id or $ caso_e, keep the information of the table as does $ institution, because this way how to show it in the view ... in advance many thanks to what the moeleti to help me take