承接 jhacobs/laravel-searchable 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jhacobs/laravel-searchable

Composer 安装命令:

composer require jhacobs/laravel-searchable

包简介

Search through models

README 文档

README

Packagist Version GitHub PHP Workflow

Search through models with laravel searchable

Installation

You can install the package via composer

  composer require jhacobs/laravel-searchable

Usage/Examples

Prepare your models

Add the Searchable trait to the model you want to search through.

namespace App\Models\User;

use Illuminate\Database\Eloquent\Model;
use Jhacobs\Searchable\Searchable;

class User extends Model
{
    use Searchable;
}

Then add the fields you want to be searchable to the $searchables property.

namespace App\Models\User;

use Illuminate\Database\Eloquent\Model;
use Jhacobs\Searchable\Searchable;

class User extends Model
{
    use Searchable;

    protected $searchables = [
        'name',
        'email'
    ];
}

Searching models

You can search through your models by using the search scope.

User::search('Henk')
    ->get();

Running Tests

To run tests, run the following command

  composer test

License

MIT

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固