5dmatwebsearch/advancesearch 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

5dmatwebsearch/advancesearch

Composer 安装命令:

composer require 5dmatwebsearch/advancesearch

包简介

Fulltext Search for laravel ...

README 文档

README

Description

Full text search in laravel on single or multiple fields

Installation

 composer require 5dmatwebsearch/advancesearch:dev-master 

Add service provider (in config/app.php -> 'providers')

 AdvanceSearch\AdvanceSearchProvider\AdvanceSearchProvider::class, 

Add aliases (in config/app.php -> 'aliases')

 'Search' => AdvanceSearch\AdvanceSearchProvider\Facades\SearchFacades::class, 

Add index

Add index to fields

 php artisan index:table table fields 

table = the table name
fields = the fields you can add. One or more fields can be added like this: title,description,tags

Example

 php artisan index:table films title,description 

Search

You can now use the search function

 Search::search(modelName , fields, searchText ,select , order , pagination , limit)

modelName = The table name
fields = The fields you can add title,description,tags
searchText = The text you're looking for
select = The fields you want a return from. You can return with one field like this: title. Or more than one like ['title' , 'description']
order = You can pass a single order field like this: id. Or you can pass the field and the way like this ['id' , 'desc']
pagination = True if you want pagination to be enabled, false if not. The package will paginate by default
limit = The amount of results you want returned. (10 by default)

First example with pagination

Search::search( "Films" , ['title' , 'description'] , "Drama Outback GOLDFINGER" , ['modelName' , 'title', 'description'], ['film_id' , 'asc'] , true , 30 )

Second example with pagination

Search::search( "Films" , ['title' , 'description'] , "Drama Outback GOLDFINGER" , ['id' , 'title', 'description'], 'film_id' )

Example without pagination

Search::search( "Films" , ['title' , 'description'] , "Drama Outback GOLDFINGER" , ['film_id' , 'title', 'description'], 'film_id', false )->where('film_id' , 10)->get()

统计信息

  • 总下载量: 3.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 50
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 50
  • Watchers: 3
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固