定制 hnhdigital-os/laravel-model-search 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hnhdigital-os/laravel-model-search

Composer 安装命令:

composer require hnhdigital-os/laravel-model-search

包简介

Query a model.

README 文档

README

___  ___          _      _ _____                     _     
|  \/  |         | |    | /  ___|                   | |    
| .  . | ___   __| | ___| \ `--.  ___  __ _ _ __ ___| |__  
| |\/| |/ _ \ / _` |/ _ \ |`--. \/ _ \/ _` | '__/ __| '_ \ 
| |  | | (_) | (_| |  __/ /\__/ /  __/ (_| | | | (__| | | |
\_|  |_/\___/ \__,_|\___|_\____/ \___|\__,_|_|  \___|_| |_|
                                                           

Search a model by providing an array of attributes. Correctly builds relationships and the appropiate query. Provides inline operaters for improved user searching.

Latest Stable Version Total Downloads Latest Unstable Version Built for Laravel License Donate to this project using Patreon

This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.

Documentation

Requirements

  • PHP 8.0.2
  • Laravel 9

Install

Via composer:

$ composer require hnhdigital-os/laravel-model-search ~3.0

Configuration

Enable the trait on any given model.

use HnhDigital\ModelSearch\ModelTrait as ModelSearchTrait;

class SomeModel extends Model
{
    use ModelSearchTrait;
}

Usage

A simple search could be:

SomeModel::search(['title' => 'Test']);
SomeModel::search(['title' => [['=', 'Test']]]);
SomeModel::search(['title' => '= Test']);
SomeModel::search(['title' => '!= Test']);

For a better look at what is possible, check out the tests/ModelTest.php test case for an extensive list of possiblities.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固