malekbenelouafi/laravel-status 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

malekbenelouafi/laravel-status

Composer 安装命令:

composer require malekbenelouafi/laravel-status

包简介

Laravel status a simple, automatic Status check for any model based on Laravel.

README 文档

README

License Latest Stable Version Total Downloads Latest Unstable Version License composer.lock available Code Intelligence Status Build Status Scrutinizer Code Quality

A simple, automatic Status check for any model based on Laravel 4.* - 5.*

What are the benefits?

You can check the status of any module with sample way.

Installation

To get started, require this package

  • Via Composer
 composer require malekbenelouafi/laravel-status
  • Via composer.json file

Add the following to the require section of your projects composer.json file.

"malekbenelouafi/laravel-status": "1.*",

Run composer update to download the package

 composer update

Usage

Migrations

When using the migration you should add new columnstatus.

$table->tinyInteger('status')->comment('0: inactive; 1: active');

it's will create column status name inside of our database schema, To be ready to receive check the model.

Simply, the schema seems something like this.

Schema::create('users', function (Blueprint $table) {

  $table->increments('id');
  $table->tinyInteger('status')->comment('0: inactive; 1: active');
  ....
  ....
  $table->timestamps();
});

Models

Use this trait in any model.

To set up a model to using Uuid, simply use the HasStatus trait:

use Illuminate\Database\Eloquent\Model;
use Malekbenelouafi\LaravelStatus\HasStatus;

class ExampleModel extends Model
{
  use HasStatus;
  ....
}

Controller

When you create a new instance of a model which uses Status, our package will automatically by deafult get only active items also you can uses this scope methods:

  • ExampleModel::withInactive(): to get all element together ( all )
  • ExampleModel::withoutInactive(): to get items Without inactive element ( only active ) => by default
  • ExampleModel::onlyInactive(): to get only inactive element

Support

If you are having general issues with this package, feel free to contact me malekbelouafi@gmail.com.

If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request.

If you're using this package, I'd love to hear your thoughts. Thanks!

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固