public function search($term)
    {
        $query = $this->model->orderBy('created_at', 'desc');
        $query->where('id', 'LIKE', '%'.$input['term'].'%');

        $columns = Schema::getColumnListing(str_plural($this->modelName));

        foreach ($columns as $attribute) {
            $query->orWhere($attribute, 'LIKE', '%'.$input['term'].'%');
        }

        return [
            'term' => $input['term'],
            'result' => $query->paginate(Config::get('cms.pagination', 24)),
        ];
    }
public function search($term)
    {
        $query = $this->model->orderBy('created_at', 'desc');
        $query->where('id', 'LIKE', '%'.$input['term'].'%');

        $columns = Schema::getColumnListing(str_plural($this->modelName));

        foreach ($columns as $attribute) {
            $query->orWhere($attribute, 'LIKE', '%'.$input['term'].'%');
        }

        return [
            'term' => $input['term'],
            'result' => $query->paginate(Config::get('cms.pagination', 24)),
        ];
    }
public function search ( $ term ) { $ query = $ this -> model -> orderBy ( 'created_at' , 'desc' ) ; $ query -> where ( 'id' , 'LIKE' , '%' . $ input [ 'term' ] . '%' ) ; $ columns = Schema :: getColumnListing ( str_plural ( $ this -> modelName ) ) ; foreach ( $ columns as $ attribute ) { $ query -> orWhere ( $ attribute , 'LIKE' , '%' . $ input [ 'term' ] . '%' ) ; } return [ 'term' => $ input [ 'term' ] , 'result' => $ query -> paginate ( Config :: get ( 'cms.pagination' , 24 ) ) , ] ; }
Search for the API Item

@param  string $term

@return array
Search for the API Item