i have this code for select id from table petugas and have statement where from auth
$petugas = petugas::where('ID_PETUGAS','=',auth()->user()->id);
and i want put that id to this code
Peminjaman::create([
'ID_ANGGOTA' => $request->ID_ANGGOTA,
'ID_BUKU' => $request->ID_BUKU,
'ID_PETUGAS' => $petugas->ID_PETUGAS, --> to this
'TANGGAL_PINJAM' => $request->TANGGAL_PINJAM,
'TANGGAL_KEMBALI' => $request->TANGGAL_KEMBALI
]);
how to take the input of these variables ?
question from:
https://stackoverflow.com/questions/65643137/how-to-make-variable-from-eloquent-select 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…