Commit 2116e943 authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Fixed bug in Input API Controller /next.

parent 2f3a32bd
......@@ -6,7 +6,7 @@ use App\Input;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
class InputController extends Controller {
/**
......@@ -16,7 +16,7 @@ class InputController extends Controller {
*/
public function next() {
$input = Input::where('listed', true)
->where('uses', '<=', 'max_uses')
->where('uses', '<', DB::raw('max_uses')) // Eloquent escapes the 3rd value.
->orWhere('max_uses', null)
->orderBy('uses')
->first();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment