Is there a way to make a Delete with Inner Join on Laravel 4 through a query builder?
I have this sample query (sample query taken from this source.):
DELETE s.* FROM spawnlist s
INNER JOIN npc n ON s.npc_templateid = n.idTemplate
WHERE (n.type = "monster");
I've tried something like:
DB::table('spawnlist as s')
->join('npc as n', 's.npc_templateid', '=', 'n.idTemplate')
->where('n.type', 'monster')
->delete();
But the it seems that the join cannot be done here?