Download the PHP package forone/administrator without Composer

On this page you can find all versions of the php package forone/administrator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package administrator

实在招不到人,在此打个广告,招Laravel工程师,请联系 [email protected] 或 1283233833

框架Demo地址:Demo

Demo账号:[email protected] 密码:admin

Demo源码:源码

ForoneAdministrator 是一款基于Laravel5.2封装的后台管理系统,集成了Entrust权限管理,并针对业务的增删改查进行了视图和业务层的封装,有助于进行后台管理系统的快速研发。

效果图

PC端

移动端

安装初始化

系统要求:

由于不可抗力因素,最好在compoer.json里加入如下配置后再开始安装,设置国内的composer镜像同时也可设置直接从国内git服务器上下载。 由于使用的entrust还处于dev状态,所以需要将composer.json里的minimum-stability 设置为 dev

由于启用了 "minimum-stability" : "dev",Laravel的dev版本会导致paginate出错,请在composer.json里将laravel版本设置为确定的版本号,例如5.1.4

使用composer进行安装 5.2.x版本

编辑 config/app.php 注册 providersaliases

发布资源,运行下面命令会自动生成默认的配置文件并复制静态文件和数据库文件

修改.env通过环境变量设置初始管理员账号密码

ADMIN_EMAIL默认为[email protected] ADMIN_PASSWORD默认为admin

系统初始化

用户表默认使用admins表,用户模型使用Forone类的Admin模型,在laravel自带的auth.app内配置model项,

5.2.0之后laravel版本,在用户模型内请务必删除继承的AuthorizableContract类,否则会报错

App\User添加Entrust的Trait,以便使用一些封装的方法

使用EntrustUserTrait的时候注意需要引入该类:

现在就可以使用.env里的管理员账号密码登陆了

forone配置

权限控制

权限控制主要分两部分,一部分是控制菜单是否显示,通过菜单的permission属性即可完成,另一部分是控制路由,通过admin.permission中间件传参来进行控制即可,主要有两种使用场景:

1分钟完成分类管理模块

以最简单的模块为实例,假设数据库已建好,需要创建一个分类管理模块

  1. 复制PermissionsController并粘贴更名为CategoriesController;复制views/permissions文件夹并粘贴更名为views/categories
  2. 编辑CategoriesController,修改以下几处:
    • 修改类名为文件名
    • 修改构造函数的uri和name为 parent::__construct('categories', '分类管理');
    • 批量修改PermissionCategory
    • 修改index里的数据列表显示项
    • Request类视情况调整
  3. 编辑views/categories/form.blade.php,修改输入项及描述名称
  4. 编辑routes.php添加路由 Route::resource('categories', 'CategoriesController');
  5. 编辑forone.php添加菜单 "分类管理"=>["uri"=>"categories"]

复杂的模块可能在index或者其它部分有更复杂的改动,总体上来说Controller的结构和基本功能代码及views的都可以复用

视图控件

详细描述封装好的便于使用的数据控件

数据列表

用法:{!! Html::datagrid($results) !!}

数据:数据源为数组

数据项参数:

  1. 列名称
  2. 数据项的属性,其中buttons是固定的按钮列使用属性
  3. 有以下几种情况:
    • 可以为空,就按默认情况显示
    • 可以为数字,为显示的列宽
    • 可以为函数,用以处理数据项并返回显示结果,包括根据不同权限返回不同结果等,作为函数的时候也可以直接返回html代码以显示任意内容
  4. 为函数,作为buttons项的时候,返回的按钮数组有以下几种情况:
    • 查看,编辑默认会跳转到查看和编辑页面
    • 启用,禁用默认会单独修改数据项的enabled字段
    • 点击按钮后需要修改某个字段为某个值,比如审核通过或者驳回之类: [['name'=>'审核','class'=>'btn-danger'],['tested'=>'true','other'=>'somevalue']] 第一个数组描述按钮的名称和样式,第二个数组描述需要更改的字段和值
    • 点击按钮后需要调用某个接口并传参数:[['name' => '审核', 'uri' => 'lastInstance.get', 'method' => 'GET','id'=>$project->id],[]],uri使用路由名称
    • 点击按钮后需要弹出某个弹出框,['配置','#modal'],就会弹出来id为modal的弹出框

数据列表头 - 新增、检索、过滤筛选等

用法:

数据项参数:

  1. new 表示是否显示新增按钮,点击后跳转到创建页面
  2. search 表示是否显示检索输入框,输入检索内容后,默认以keywords为参数传递到后端接口,相当于?keywords=xxx
  3. title 标题
  4. filters 数据源为数组,如下:

statusother是该数据项的字段名,它们对应的数组是显示出来供选择的选项,选择后会自动提交请求,相当于?status=''&other=''。 相应的在Controller的index方法里,添加很简单的代码即可实现分页的同时自动加上相应的参数,并根据参数过滤相应的内容,如下:

针对简单内容的筛选,基本上检索代码都可以直接Copy使用,仅需修改Model即可

下拉列表选择

用法:

参数:

  1. 字段名
  2. 数据项的Label名称
  3. 下拉列表数据,label表示显示出来的内容,value表示存储的时候使用的内容
  4. 长度,默认是bootstratp整行的一半,等同于col-md-6
  5. 是否用于modal,因为modal样式有些差异,所以加了这个参数

单选radio

用法:

参数:

  1. 字段名
  2. 数据项的Label名称
  3. 数据内容,包括
    • 存储时用的数据
    • 显示出来的名称
    • 是否默认选中
  4. 长度,默认是bootstratp整行的一半,等同于col-md-6,radio因为经常比较多,默认是1

时间控件

用法:

参数:

  1. 字段名
  2. label名称
  3. 提示文字

日期控件

用法:

参数:

  1. 字段名
  2. label名称
  3. 提示文字

单行文本输入

用法:

多行文本输入

用法:

单文件上传

用法:

参数:

  1. 字段名
  2. 项名称
  3. 项宽度,默认0.5
  4. 上传平台,目前默认且仅支持qiniu

多文件上传

用法:

参数:

  1. 字段名
  2. 项名称
  3. 是否显示图片描述输入框
  4. 项宽度,默认0.5
  5. 上传平台,目前默认且仅支持qiniu

文件浏览器

用法:

参数:

  1. 字段名
  2. 项名称
  3. 项宽度,默认0.5

富文本编辑器

用法:

参数:

  1. 字段名
  2. 项名称
  3. 项宽度,默认0.5

提高研发效率的几个自定义命令


All versions of administrator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/routing Version 5.1.*
illuminate/support Version 5.1.*
illuminate/html Version 5.0.0
doctrine/dbal Version ^2.5
qiniu/php-sdk Version v7.0.4
orangehill/iseed Version ^2.0
zizaco/entrust Version dev-laravel-5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package forone/administrator contains the following files

Loading the files please wait ....