shushushushushu/laravel-admin 问题修复 & 功能扩展

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

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

shushushushushu/laravel-admin

Composer 安装命令:

composer require shushushushushu/laravel-admin

包简介

shushushushushu laravel admin

README 文档

README

laravel-admin

laravel-admin is administrative interface builder for laravel which can help you build CRUD backends just with few lines of code.

Documentation | 中文文档 | Demo | Demo source code | Extensions

Inspired by SleepingOwlAdmin and rapyd-laravel.

Sponsor

laravel-admin

###statement This is a replica that clone from laravel-admin,and make some changes to meet product requirements.

Requirements

  • PHP >= 7.0.0
  • Laravel >= 5.5.0
  • Fileinfo PHP Extension

Installation

This package requires PHP 7+ and Laravel 5.5, for old versions please refer to 1.4

First, install laravel 5.5, and make sure that the database connection settings are correct.

composer require shushushushushu/laravel-admin:^1.2.0

Then run these commands to publish assets and config:

php artisan vendor:publish --provider="shushushushushu\Admin\AdminServiceProvider"

After run command you can find config file in config/admin.php, in this file you can change the install directory,db connection or table names.

At last run following command to finish install.

php artisan admin:install

Open http://localhost/admin/ in browser,use username admin and password admin to login.

Configurations

The file config/admin.php contains an array of configurations, you can find the default configurations in there.

Extensions

Extension Description laravel-admin
helpers Several tools to help you in development ~1.5
media-manager Provides a web interface to manage local files ~1.5
api-tester Help you to test the local laravel APIs ~1.5
scheduling Scheduling task manager for laravel-admin ~1.5
redis-manager Redis manager for laravel-admin ~1.5
backup An admin interface for managing backups ~1.5
log-viewer Log viewer for laravel ~1.5
config Config manager for laravel-admin ~1.5
reporter Provides a developer-friendly web interface to view the exception ~1.5
wangEditor A rich text editor based on wangeditor ~1.6
summernote A rich text editor based on summernote ~1.6
china-distpicker 一个基于distpicker的中国省市区选择器 ~1.6
simplemde A markdown editor based on simplemde ~1.6
phpinfo Integrate the phpinfo page into laravel-admin ~1.6
php-editor
python-editor
js-editor
css-editor
clike-editor
Several programing language editor extensions based on code-mirror ~1.6
star-rating Star Rating extension for laravel-admin ~1.6
json-editor JSON Editor for Laravel-admin ~1.6
grid-lightbox Turn your grid into a lightbox & gallery ~1.6
daterangepicker Integrates daterangepicker into laravel-admin ~1.6
material-ui Material-UI extension for laravel-admin ~1.6
sparkline Integrates jQuery sparkline into laravel-admin ~1.6
chartjs Use Chartjs in laravel-admin ~1.6
echarts Use Echarts in laravel-admin ~1.6
simditor Integrates simditor full-rich editor into laravel-admin ~1.6
cropper A simple jQuery image cropping plugin. ~1.6
composer-viewer A web interface of composer packages in laravel. ~1.6
data-table Advanced table widget for laravel-admin ~1.6
watermark Text watermark for laravel-admin ~1.6
google-authenticator Google authenticator ~1.6

Changes

1.method sanitizeInput() in src\Form\Field.php change as:

protected function sanitizeInput($input, $column)
{
    if ($this instanceof Field\MultipleSelect) {
        $value = Arr::get($input, $column);
        Arr::set($input, $column, array_filter($value, function($val){
            return $val !== '' && $val !== null && $val !== false;
        }));
    }
    return $input;
}
purpose: submit form can be access when checkbox select 0 and rule contains required

2.reform component 'Select':

①method ajax() in src\Form\Field\Select.php
change select2's delay time of ajax request from 250ms to 500ms

②change name of a hidden input and set value:
<input type="hidden" name="{{$name}}"/>
change as 
<input type="hidden" name="{{$name}}_hide" value="{{old($column, $value)}}"/>
that can get old value when select option list from ajax request,

3.insert error tips into resources/views/form.blade.php line 12:

@foreach($errors->getBags() as $bags)
    <div class="alert alert-danger">{{$bags->first()}}</div>
@endforeach

4.in order to use alioss and support full url with domain make some changes in src\Form\Field\Image.php -> prepare():

if(isset(config('filesystems.disks.' . config('filesystems.default'))['remote_url'])){
    $remoteUrl = config('filesystems.disks.' . config('filesystems.default'))['remote_url'];
    $path = rtrim($remoteUrl, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $path;
}//add domain before return path if config remote_url

return $path;

5.login page add smscode verify using easy-sms These changes occurs in the tag 1.2.0 and some configuration is needed to make sure it works properly.

①users table add a column:

$table->char('mobile', 11);

②fill configurations of redis and the normal operation of the redis.

③add configuration of easysms to admin.config: first add 'auth/sendsms' to "auth['excepts']" ensure interface 'auth/sendsms' not need auth, and second:

'login_use_sms' => true,

'easysms' => [
    'timeout' => 5.0,
    'length' => 4,
    'expire' => 300,
    'product' => '',
    'default' => [
        'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class,
        'gateways' => [
            'aliyun'
        ]
    ],
    'gateways' => [
        'errorlog' => [
            'file' => '/tmp/easy-sms.log',
        ],
        'aliyun' => [
            'access_key_id' => env('ALIYUN_ACCESS_KEY_ID', ''),
            'access_key_secret' => env('ALIYUN_SECRET_ACCESS_KEY', ''),
            'sign_name' => env('ALIYUN_SMS_SIGN_NAME', ''),
        ]
    ]
],

if set login_use_sms=false,sms will be disabled.

you need config some env in .env forexample 'access_key_id' and son on. For details, please see easysms official website

6.src/Form.php:

public function inputAll()
{
    return $this->inputs;
}

License

laravel-admin is licensed under The MIT License (MIT).

shushushushushu/laravel-admin 适用场景与选型建议

shushushushushu/laravel-admin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 06 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「admin」 「form」 「grid」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 shushushushushu/laravel-admin 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-22