How can I convert this query to eloquent (I've tried it and I ask to ask since I have no idea)
select id from solicitudes where id not in (select autorizaciones.solicitud_id from autorizaciones)
How can I convert this query to eloquent (I've tried it and I ask to ask since I have no idea)
select id from solicitudes where id not in (select autorizaciones.solicitud_id from autorizaciones)
This can be worth to you:
DB::table('solicitudes')
->select('id')
->whereNotIn('id', DB::table('autorizaciones')->pluck('id'))
->get();
With models:
Solicitud::select('id')
->whereNotIn('id', Autorizacion::pluck('id'))
->get();