I wonder if there is any way to know if a column exists in Laravel
.
For example, I want to sort with data coming from the query string. If the value "column" exists in the table, then I command by that field.
$coluna = Input::get('coluna');
if (se_a_coluna_existe_na_tabela('usuarios', $coluna))
{
$query->orderBy($coluna);
}