r4nkt/laravel-manageable 问题修复 & 功能扩展

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

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

r4nkt/laravel-manageable

Composer 安装命令:

composer require r4nkt/laravel-manageable

包简介

Track users who manages models in your Laravel app. (Forked from signifly/laravel-manageable.)

README 文档

README

Latest Version on Packagist Build Status StyleCI Quality Score Total Downloads

The r4nkt/laravel-manageable package allows you to easily track who creates/updates your models.

All you have to do to get started is:

// 1. Add required columns to your table by using our macro manageable
Schema::create('orders', function (Blueprint $table) {
    // ...
    $table->manageable();

    // params: $bigIntegers (default: true), $foreignTable (default: 'users'), $foreignKey (default: 'id')
    $table->manageable(false, 'some_users_table', 'u_id');
});

// 2. Add the Manageable trait to your model
class Order extends Model
{
    use Manageable;
}

The macro manageable adds the following to your table:

$this->unsignedBigInteger('created_by')->nullable()->index();
$this->unsignedBigInteger('updated_by')->nullable()->index();

$this->foreign('created_by')
    ->references('id')
    ->on('users')
    ->onDelete('set null');

$this->foreign('updated_by')
    ->references('id')
    ->on('users')
    ->onDelete('set null');

Likewise, the macro unmanageable does the following to your table:

$this->dropForeign(['created_by']);

$this->dropForeign(['updated_by']);

$this->dropColumn(['created_by', 'updated_by']);

Documentation

Until further documentation is provided, please have a look at the tests.

Installation

You can install the package via composer:

composer require r4nkt/laravel-manageable

The package will automatically register itself.

You can publish the config with:

php artisan vendor:publish --provider="R4nkt\Manageable\ManageableServiceProvider"

Testing

composer test

Security

If you discover any security issues, please email dev@r4nkt.com instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固