meerkatmcr/simple-blocker 问题修复 & 功能扩展

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

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

meerkatmcr/simple-blocker

Composer 安装命令:

composer require meerkatmcr/simple-blocker

包简介

Simple user-blocking functionality for Laravel 5.x

README 文档

README

Very simple user-blocking functionality for Laravel 5.x

Installation

Notes

This package assumes that your users table is called users. If it is not, publish the migration and edit the table name.

Method

  • Install the package with composer install meerkatmcr/simple-blocker
  • Perform the database migration php artisan migrate
  • Add the MeerkatMcr\SimpleBlocker\Traits\Blockable trait to your user model.

Usage

Blocking and unblocking

The Blockable trait provides three methods:

  • block() block the user
  • unblock() unblock the user
  • isBlocked() return TRUE if the user is blocked

block() and unblock() are both fluent, and neither saves the model.

Middleware

The MeerkatMcr\SimpleBlocker\Middleware\CheckUserBlocked middleware will abort a request with code 403 if the current user is blocked.

To use it, register it in app/Http/Kernel.php as with any other middleware class. See the Laravel manual for further details.

The abort message is configurable - its key is simple-blocker.message. This package publishes its config file (simple-blocker.php).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固