承接 dainsys/locky 相关项目开发

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

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

dainsys/locky

Composer 安装命令:

composer require dainsys/locky

包简介

A laravel UI wrapper for spatie/laravel-permission with Bootstrap 4!

README 文档

README

A laravel UI wrapper for spatie/laravel-permission with Bootstrap 4!

Installation

  • Install with composer by runining the command composer require dainsys/locky
  • Add the Dainsys\Locky\WithLockyAcl; to your User model(s);
use Illuminate\Foundation\Auth\User as Authenticatable;
use Dainsys\Locky\WithLockyAcl;

class User extends Authenticatable
{
    use WithLockyAcl;
}
  • Add the following item to the protected $casts array:
      protected $casts = [
          'inactivated_at' => 'date'
      ];
  • Set you LOCKY_SUPER_USER_EMAIL=super.user@email-example.com in the .env file.
  • This package relies on you having an auth system. We strongly suggest using laravel/jetstream, laravel/freeze or the legacy laravel/ui
  • Views:
  • The package ships with it's own views, therefore you MUST publish the package public assets by running php artisan vendor:publish --tag=locky-public. However, this is not necessary if you are planning to use your views. In this case you can run php artisan vendor:publish --tag=locky-views and make them extends your own layout view.
  • Migrations:
  • By default the packages migrations will run if you execute the php artisan migrate command. However, you can set the with_migrations option to false and handle the migrations yourselve. To do this, first run the php artisan vendor:publish --tag=locky-config command.
  • Add the following liks to the auth portion of your layouts.app links:
@include('locky::_nav-links')
  • You could also publish the package migrations by running php artisan vendor:publish --tag=locky-migrations and tweak them to suit your needs.

Usage

  • After installing this package, you can limit user access by creating Laravel Policies with php artisan make:policy command and add the checks return $user->hasAnyRole(["role1", "role2"]) or return $user->hasAnyPermission(["permission1", "permission2"]) and by updating the Controller's constructor method:
use App\YourModel;

class MyController extends Controller
{
    public function __construct()
    {
        $this->authorizeResource(YourModel::class, 'model');
    }
}
  • Please read Larave Authorization's documentations at https://laravel.com/docs/7.x/authorization
  • This package add the concept of actives or inactive users by adding query scopes. Just use the scope actives() or inactives() to filter as desired.
  • You can activate an user by calling the activate() method on a Eloquent User record; use inactivate() to inactivate an user.

Dependencies

dainsys/locky 适用场景与选型建议

dainsys/locky 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 58 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 dainsys/locky 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dainsys/locky 我们能提供哪些服务?
定制开发 / 二次开发

基于 dainsys/locky 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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