I am new to Laravel and I am trying to receive the clasa_id from the clasa table in the elevi table.
$clasa = new Clasa();
$clasa->cifra = \Auth::user()->clasa_cifra;
$clasa->litera = \Auth::user()->clasa_litera;
$clasa->save();
$elev = new Elevi();
$elev->nume = $request['nume'];
$elev->prenume = $request['prenume'];
$elev->clasa_id = ?????
$elev->save();
Firstly in the clasa table I add the clasa_cifra and clasa_litera, and generate an auto increment clasa_id and I want to make a
select 'clasa_id' from 'clasa' where 'clasa_cifra=\Auth::user()->clasa_cifra, clasa_litera=\Auth::user()->clasa_litera'
and add it to the clasa_id from the elevi table
how to implement it? Thank you!