承接 stephenjude/default-model-sorting 相关项目开发

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

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

stephenjude/default-model-sorting

最新稳定版本:4.0.0

Composer 安装命令:

composer require stephenjude/default-model-sorting

包简介

Add default sorting column to your eloquent model

README 文档

README

Latest Version on Packagist Build Status Total Downloads

Add default sorting column to your eloquent model.

Installation

You can install the package via composer:

composer require stephenjude/default-model-sorting

Basic Usage

use Stephenjude\DefaultModelSorting\Traits\DefaultOrderBy;

class Article extends Model
{
    use DefaultOrderBy;

    protected static $orderByColumn = 'title';
}

Column Sorting Order

You can change the default column sorting order by adding the $orderByColumnDirection property inside your eloquent model.

use Stephenjude\DefaultModelSorting\Traits\DefaultOrderBy;

class Article extends Model
{
    use DefaultOrderBy;

    protected static $orderByColumn = 'title';

    protected static $orderByColumnDirection = 'desc';
}

Configurations

Publishing Config

You can publish the config file by running the vendor:publish command

php artisan vendor:publish --provider="Stephenjude\DefaultModelSorting\DefaultModelSortingServiceProvider" --tag="config"

Configuring Default Column Sorting Order

You can change the default sorting order inside the config file:

'order_by' => 'asc',

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hello@stephenjude.me instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

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

GitHub 信息

  • Stars: 38
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-01