Hi, I want to show more data in a select with the pluck method, does anyone know how to do it?
It turns out that I have a Course table, which has a name and type as attributes. I want to give a course to a student, but with the pluck that I have only shows me the name of the course, I want it to appear with the type also in the select.
This is my controller
public function edit($id)
{
$alumno = Alumno::find($id);
$cursos = Curso::orderBy('id','ASC')->pluck('nombre','id');
$alumno->curso;
$apoderados = Apoderado::orderBy('id','ASC')->pluck('nombre','id');
$alumno->apoderado;
return view('alumnos.edit')->with('alumno', $alumno)->with('cursos',$cursos)->with('apoderados',$apoderados);
}
How can I concatenate that course name with the type ?? help