I just started with Laravel and I have several problems ... the fact is that I was using the \ DB ::
Like this for example that you already know:
$macUsuario=\DB::table($this->tablaMac)
->join($this->tablaUsuario, $this->tablaUsuario . '.Correo', '=', $this->tablaMac . '.Id_usuario')
->select('Direccion_mac', 'Descripcion', 'Correo', 'Nombre', 'Apellidos', 'Fecha')
->where('Departamento', '=', $departamento)
->get();
And I've been told to use the OROs of eloquent "or something like that", I've seen this video
It turns out that at minute 21.04 it does:
$estudiante = Estudiante::find(1);
If I understand correctly, you will look for the PrimaryKey "1" in the Student table, no?
The fact is that I see no difference with using
$persona=\DB::table($this->Estudiante)
->select("Nombre","Apellido")
->where('pk','=',1)
->get();
The one to use less line of code, but I see it better because this way you do not bring all the fields of the BBDD, only the ones that you need ...
Also if possible, tell me more videos or documentation for newbies to understand it better, on YouTube you only have the videos of Duilio Palacios and I do not know anything at all.
Thanks for your time.