public function getSearch() { $term = Input::get('term'); $alunos = Aluno::whereRaw('aluno.nome COLLATE UTF8_GENERAL_CI LIKE ?')->join('turma', 'turma.id', '=', 'aluno.turma_id')->orWhereRaw('sigla COLLATE UTF8_GENERAL_CI LIKE ?')->orWhereRaw('descricao COLLATE UTF8_GENERAL_CI LIKE ?')->setBindings(['%' . $term . '%', '%' . $term . '%', '%' . $term . '%'])->get(); $turmas = Turma::whereRaw('sigla COLLATE UTF8_GENERAL_CI LIKE ?')->orWhereRaw('descricao COLLATE UTF8_GENERAL_CI LIKE ?')->setBindings(['%' . $term . '%', '%' . $term . '%'])->get(); return View::make('aluno.search', ['alunos' => $alunos]); }