I have an author name "Cronix" who wrote an article "I love Laravel".
So I do a search for Laravel, it returns the result because the title has the search term "Laravel".
Say I search for "Cronix", it returns "null".
You shouldn't have to search for the author, as there will be an author.
Surely you have the blog table and author linked by author_id.
You probably could in your case just do a simple left join
along with a group by
and use two order by statements like
order by title
order by author
Because you only want matches that have part of that title and show the author.
Remember could be several authors and several post
But again you may want to order by author first and title second. Hard to say.
Sometimes eloquent is alright for a simpler one to many, but as things get a little more complex, I just prefer normal queries.
Just done in raw mysql quickly from my test db, but something like:
SELECT dc_powners.ownerid, dc_pets.petid, dc_pets.petowner, dc_pets.petname
FROM dc_powners LEFT JOIN dc_pets ON dc_powners.ownerid = dc_pets.ownerid
WHERE dc_powners.ownerid IS NOT NULL AND dc_powners.ownerid > 0 AND dc_pets.petid IS NOT NULL
GROUP BY dc_powners.ownerid, dc_pets.petname;
Here is image https://imgur.com/AMDPh9X
Remember
Even regular queries need some trial and error and tweaking to get right, unless you use a query designer. I usually use the one in MS ACCESS and convert over to PDO as needed.
But again I just whipped this up quickly before bed time.
But you could take those results and loop (foreach) easily in the view.
If thousands of results, that's where a temp table comes in,
or a custom LengthAware Paginator.
It is nothing for some large industry to run large queries (reports) over night. They deal with tens of thousands of records or millions.
But you probably only have a few hundred, but remember it can grow.