public function scopeOrder($query)
    {
        $order = Input::get('order', isset($this->order) ? $this->order : 'id') ?: 'id';
        $direction = Input::get('direction', isset($this->direction) ? $this->direction : 'desc') ?: 'desc';

        return $query->orderBy($order, $direction);
    }