/** * Display a listing of the resource. * GET /workorders * * @return Response */ public function index() { if (Input::has("filter") && Input::has("filterText")) { return Workorder::with('user')->with('property')->where(Input::get('filter'), Input::get('filterText'))->get(); } return Workorder::get(); }