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

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

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

alirezaghasemi/laravel-searchable

最新稳定版本:1.0.0

Composer 安装命令:

composer require alirezaghasemi/laravel-searchable

包简介

A Laravel package for adding search functionality to models.

README 文档

README

A Laravel package for adding search functionality to models

Installation :

composer require alirezaghasemi/laravel-searchable

Usage :

  • use Searchable trait in your model
  • Define $searchable property in your model to select which columns to search in

Example (User Model Relation With Post):

use AlirezaGhasemi\LaravelSearch\Searchable;

class User extends Model {

  use Searchable ;
  protected $searchable = ['name', 'mobile', 'posts.title','posts.comments.title'];
  
  public function posts(){
    return $this->hasMany(Post::class);
  }

Example (Post Model Relation with Comment):

class Post extends Model {

public function comments(){
  return $this->hasMany(Comment::class);
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-26