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

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

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

shrft/laravel-admin-bar

Composer 安装命令:

composer require shrft/laravel-admin-bar

包简介

Add admin toolbar to the front side of your website.

README 文档

README

This package help you add Wordpress like admin bar to your Laravel application. Admin bar is an easy-to-access toolbar to your admin pages.

admin-bar

Supported Version

  • laravel/framework >= 5.5

Installation

To instal laravel-admin-bar, require it by Composer:

composer require shrft/laravel-admin-bar

Once Composer is done, run the following command:

php artisan vendor:publish --provider="Shrft\AdminBar\AdminBarServiceProvider"

If you visit your page, you already have Admin bar!

Basic Usage

You can configure how and when admin bar should be shown via the configuration file called adminbar.php. If you have already run the publish command above, you should already have this file under the config directory.

The following is the default setup of the adminbar.php You can learn how to configure Admin Bar from the doc blocks of this file.

return array(

    /**
     *  
     * Change this to false to disable admin bar
     * 
     * */
    'enabled'=>true,

    /**
     * 
     * Please specify your admin pages' url so that Admin Bar does not show up in 
     * your admin pages. 
     * 
     * The default is 'admin/*'
     * The pass is checked with Illuminate\Http\Request::is().
     *  
     * */
    'excludes' => 'admin/*',

    /**
     * 
     * In order to show Admin Bar only for logged in admin users,
     * please specify how to tell if current visitor is logged in and also an admin 
     * user.
     * 
     * As a default, we just return true.
     * 
     * */
    'is_admin' => function(){

       // This is an example code. 
       // 
       // if( Auth::user() &&  Auth::user()->isAdmin()){
       //     return true;
       // }
       // return false;
        
        return true;
    },
    /**
     * 
     * Specify links to show on Admin Bar.
     * 
     * */
    'menus' => array(
        ['title'=>'Admin Top', 'path'=>'/admin'],
        ['title'=>'Add a post', 'path'=>'/admin/post/new'],
        // you can pass callback to the path
        ['title'=>'Edit a post', 'path'=>function($request){

            // this is an example of how you generate pass dynamically.

            if($request->is('post/*')){
                $postid = $request->route('id');
                return '/admin/post/edit/' . $postid;
            }

            // if you return false, this link is not displayed.
            return false;
        }],
        // pass an array to path for dropdown menu.
        ['title'=>'Drop Down', 'path'=>[
                                 ['title'=>'Option1', 'path'=>'/path/to/option1'],
                                 ['title'=>'Option2', 'path'=>'/path/to/option2']
                                ]
        ],
        ),
);

Lincense

Laravel Admin Bar is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固