thegreyhatt/laravel-sbadmin2 问题修复 & 功能扩展

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

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

thegreyhatt/laravel-sbadmin2

Composer 安装命令:

composer require thegreyhatt/laravel-sbadmin2

包简介

Start Bootstrap Admin 2 Package

README 文档

README

This package provides an easy way to quickly set up SB Admin 2 with Laravel 5. It has no requirements and dependencies besides Laravel, so you can start building your admin panel immediately. The package just provides a Blade template that you can extend and advanced menu configuration possibilities.

1. Requirements

Laravel 5.5.x to 5.8.x PHP >= 7.0.0

2. Installation

  1. Require the package using composer:

    composer require thegreyhatt/laravel-sbadmin2
    
  2. Add the service provider to the providers in config/app.php:

    Thegreyhatt\LaravelSBAdmin2\ServiceProvider::class
  3. Publish the public assets:

    php artisan vendor:publish --provider="Thegreyhatt\LaravelSBAdmin2\ServiceProvider" --tag=assets
    

3. Updating

  1. To update this package, first update the composer package:

    composer update thegreyhatt/laravel-sbadmin2
    
  2. Then, publish the public assets with the --force flag to overwrite existing files

    php artisan vendor:publish --provider="Thegreyhatt\LaravelSBAdmin2\ServiceProvider" --tag=assets --force
    

4. Usage

To use the template, create a blade file and extend the layout with @extends('sbadmin2::page'). This template yields the following sections:

  • title: for in the <title> tag
  • content_header: title of the page, above the content
  • content: all of the page's content
  • css: extra stylesheets (located in <head>)
  • js: extra javascript (just before </body>)

All sections are in fact optional. Your blade template could look like the following.

{{-- resources/views/admin/dashboard.blade.php --}}

@extends('sbadmin2::page')

@section('title', 'Dashboard')

@section('content_header')
    Dashboard
@stop

@section('content')
    <p>Welcome to this beautiful admin panel.</p>
@stop

@section('css')
    <link rel="stylesheet" href="/css/admin_custom.css">
@stop

@section('js')
    <script> console.log('Hi!'); </script>
@stop

You now just return this view from your controller, as usual.

5. Configuration

First, publish the configuration file:

php artisan vendor:publish --provider="Thegreyhatt\LaravelSBAdmin2\ServiceProvider" --tag=config

Now, edit config/sbadmin2.php to configure the title, skin, menu, URLs etc. All configuration options are explained in the comments. However, I want to shed some light on the menu configuration.

5.1 Menu

You can configure your menu as follows:

'menu' => [
    [
    	'text'	=>	'Dashboard',
    	'url'	=>	'/dashboard',
    	'icon'	=>	'fa-tachometer-alt',
    ],
    	'Addons',
    [
    	'text'		=>	'Pages',
    	'icon'		=>	'fa-folder',
    	'submenu'	=>	[
    	'Login Screens:',
    		[
    			'text'	=>	'Login',
    			'url'	=>	'/login',
    		],
    		[
    			'text'	=>	'Register',
    			'url'	=>	'/register',
    		],
    		'Other Pages:',
    		[
    			'text'	=>	'404 Page',
    			'url'	=>	'#'
    		],
    		[
    			'text'	=>	'Blank Page',
    			'url'	=>	'#'
    		],
    	],
    ],
    [
    	'text'	=>	'Charts',
    	'url'	=>	'#',
    	'icon'	=>	'fa-chart-area',
    ],
    [
    	'text'	=>	'Tables',
    	'url'	=>	'#',
    	'icon'	=>	'fa-table',
    ],
],

With a single string, you specify a menu header item to separate the items. With an array, you specify a menu item. text and url are required attributes. The icon is optional, if you leave it out. The available icons that you can use are those from Font Awesome. Just specify the name of the icon and it will appear in front of your menu item.

6. Customize views

If you need full control over the provided views, you can publish them:

php artisan vendor:publish --provider="Thegreyhatt\LaravelSBAdmin2\ServiceProvider" --tag=views

Now, you can edit the views in resources/views/vendor/sbadmin2.

7. Issues, Questions and Pull Requests

You can report issues and ask questions in the issues section. Please start your issue with ISSUE: and your question with QUESTION:

If you have a question, check the closed issues first. Over time, I've been able to answer quite a few.

To submit a Pull Request, please fork this repository, create a new branch and commit your new/updated code in there. Then open a Pull Request from your new branch. Refer to this guide for more info.

thegreyhatt/laravel-sbadmin2 适用场景与选型建议

thegreyhatt/laravel-sbadmin2 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 50 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 07 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

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