定制 nagy/laravel-status 二次开发

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

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

nagy/laravel-status

Composer 安装命令:

composer require nagy/laravel-status

包简介

manage status column for elqouent models

README 文档

README

manage status like moderation or anysomething else for elqouent models

Install

$ composer install nagy/laravel-status

Using!

add the status column to your migration

$table->tinyInteger('status')->default(0);

define the status into your elquent model

protected static $status = [
        0 => 'pending',
        1 => 'approved',
        2 => 'rejected'
];

if you need to override the databse column or rename it

 protected static $status_column = 'status';

include the HasStatus into your model

use Nagy\LaravelStatus\HasStatus;

class User extends Model
{
    use HasStatus;

exmaples

laravel-status works daynamicly according to your defined status, for example for status pending then you will be able use it as isPending,setPending, onlyPending

// check if model has status
$model->isPending();

// update model to another status
$model->setApproved();

// get only models that has status
Model::onlyPending()->get();

// or use within a query builder
Model::where('age', '>', 18)->onlyPending()->get();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固