laravel/framework — pull request #5652 by benubird (2014-09-04 16:57:14+00:00)
Title: Adjusted the compileDelete function to allow joins when deleting

It makes no sense to disallow calling delete() for queries with joins, especially when it is such a simple fix to get it working. This commit adjusts the compileDelete function so that the following will work:

App::make('A')->join('b', 'b.x', '=', 'a.x')->where('b.y', 'z')->delete();

Previously it was (counter-intuitively) stripping out the "join" from the delete call, resulting in unpredictable results - usually an exception, but on rare occasions (e.g. when using a join to restrct the result set by the presence of a value in another table) it could execute incorrect sql, causing hard to track down heisenbugs.

I've also allowed limit and offset, mainly because I could not think of any reason to exclude them.