I need to Show column names of a model in Laravel Eloquent. I need a array to use like:
if(in_array($colum, $columns))
Maybe you can use:
use Schema;
$accept_columns = Schema::getColumnListing('users');
if(in_array($orderBy, $accept_columns))
{
//Your code goes here
}