This is a product catalog page, and I need to get 1 image for a preview.
My query now:
DB::select('SELECT
h.*
, (SELECT link
FROM media_libs m
where h.id=m.have_videos_id limit 1) as link
FROM have_videos h')
But I need pagination.
DB::select('SELECT
h.*
, (SELECT link
FROM media_libs m
where h.id=m.have_videos_id limit 1) as link
FROM have_videos h')->paginate(15)
So naturally nothing works
How to convert a query in the Facade DB?