gionnivaleriana/laravel-adminlte

语言: PHP

git: https://github.com/gionnivaleriana/laravel-adminlte

Almsaeed用于Laravel 5的睡眠猫头鹰管理生成器插件的AdminLTE模板
Almsaeed's AdminLTE Template for Sleeping Owl Admin Generator plugin for Laravel 5
README.md (中文)

Larawel AdminLTE

Build Status
Latest Stable Version
Total Downloads
Latest Unstable Version
License
HHVM Status

一个Almsaeed的AdminLTE模板,为Sleep Owl的Admin构建,是Laravel 5的管理界面构建器。

  • 安装
  • 用法
  • 要求
  • 作者

安装

第1步:下载包

打开命令控制台,输入项目目录并执行以下命令以下载此软件包的最新稳定版本:

$ composer require gionnivaleriana/laravel-adminlte:dev-master

此命令要求您全局安装Composer,如Composer文档的安装章节中所述。

第2步:启用包

然后,通过在项目的app / config.php文件中添加以下行来启用该包:

<?php
// app/config.php

return [

    'providers' => [

        // ...

        GionniValeriana\laravelAdminlte\AdminlteServiceProvider::class

    ],

    // ...

    'aliases' => [

        // ...

        'Adminlte' => GionniValeriana\laravelAdminlte\Adminlte::class,

    ],

];

第3步:使用包

要使用Sleep Owl覆盖默认值的包/模板,请修改项目的app / admin.php文件中的以下行:

app / admin.php文件是在睡眠猫头鹰的管理软件包安装过程中通过命令admin:install生成的。

<?php
// app/admin.php

return [

    // ...

    'bladePrefix' => 'adminlte::',

];

然后使用该命令将资产(css,js ..)发布到您的公用文件夹

$ php artisan vendor:publish

在AppServiceProvider中添加样式和脚本

<?php
// app/Providers/AppServiceProvider.php

    // ...

    public function register() {

        // ...

        config([
            'preload.styles' => [
                asset('packages/GionniValeriana/adminlte/bootstrap/css/bootstrap.min.css'),
                asset('packages/GionniValeriana/adminlte/plugins/font-awesome/font-awesome.min.css'),
                asset('packages/GionniValeriana/adminlte/plugins/ionicons/ionicons.min.css'),
                asset('packages/GionniValeriana/adminlte/dist/css/AdminLTE.min.css'),
                asset('packages/GionniValeriana/adminlte/dist/css/skins/_all-skins.min.css'),
                asset('packages/GionniValeriana/adminlte/plugins/iCheck/flat/blue.css'),
                asset('packages/GionniValeriana/adminlte/plugins/morris/morris.css'),
                asset('packages/GionniValeriana/adminlte/plugins/datatables/dataTables.bootstrap.css'),
                asset('packages/GionniValeriana/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css'),
                asset('packages/GionniValeriana/adminlte/plugins/datepicker/datepicker3.css'),
                asset('packages/GionniValeriana/adminlte/plugins/daterangepicker/daterangepicker-bs3.css'),
                asset('packages/GionniValeriana/adminlte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css'),
            ],
            'preload.scripts' => [
                asset('packages/GionniValeriana/adminlte/plugins/jQuery/jQuery-2.1.3.min.js'),
                asset('packages/GionniValeriana/adminlte/bootstrap/js/bootstrap.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/input-mask/jquery.inputmask.js'),
                asset('packages/GionniValeriana/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js'),
                asset('packages/GionniValeriana/adminlte/plugins/input-mask/jquery.inputmask.extensions.js'),
                asset('packages/GionniValeriana/adminlte/plugins/moment/moment.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/daterangepicker/daterangepicker.js'),
                asset('packages/GionniValeriana/adminlte/plugins/colorpicker/bootstrap-colorpicker.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/timepicker/bootstrap-timepicker.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/datatables/jquery.dataTables.js'),
                asset('packages/GionniValeriana/adminlte/plugins/datatables/dataTables.bootstrap.js'),
                asset('packages/GionniValeriana/adminlte/plugins/slimScroll/jquery.slimscroll.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/iCheck/icheck.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/fastclick/fastclick.min.js'),
            ],
        ]);
    }

然后用Sleeping Owl的bootstrap脚本加载它

<?php
// app/admin/bootstrap.php

use Illuminate\Support\Facades\Config;
use SleepingOwl\Admin\AssetManager\AssetManager;

$assets = new AssetManager();

foreach (Config::get('preload.styles') as $style) {
    $assets->addStyle($style);
}

foreach (Config::get('preload.scripts') as $script) {
    $assets->addScript($script);
}

用法

让我们开始创建一个“起始页”菜单项,如睡猫头鹰的文档中所述。

// app/admin/menu.php

Admin::menu()->url('/')
             ->label('Start Page')
             ->icon('fa-dashboard')
             ->uses('\App\HTTP\Controllers\AdminController@getIndex');

标准空白页

要从此包中查看标准空白页,请在\ App \ HTTP \ Controllers \ AdminController中使用方法AdminController :: getIndex()返回:

// app/Http/Controllers/AdminController.php

class AdminController extends \SleepingOwl\Admin\Controllers\AdminController {

    /**
     * @return \Illuminate\View\View
     */
    public function getIndex() {
        return view('adminlte::blank');
    }

    // ...

自定义页面/视图

要使用自定义视图,我们在视图文件夹中创建一个新视图(在资源/视图中默认)

// resources/views/customPage.blade.php

@section('innerContent')
    <section class="content-header">
        <h1>Custom Page</h1>
        <ol class="breadcrumb">
            <li class="active"><i class="fa fa-dashboard"></i> Home</li>
        </ol>
    </section>
    <section class="content">

        // ...

    </section>
@stop

然后在AdminController :: getIndex()中返回它

// app/Http/Controllers/AdminController.php

class AdminController extends \SleepingOwl\Admin\Controllers\AdminController {

    /**
     * @return \Illuminate\View\View
     */
    public function getIndex() {
        return view('customPage');
    }

    // ...

要求

  • Laravel 5 by Taylor Otwell
  • 睡猫头鹰管理员
  • 管理员Abdullah Almsaeed

作者

  • Joy Lazari(Gionni Valeriana)

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Laravel AdminLTE

Build Status
Latest Stable Version
Total Downloads
Latest Unstable Version
License
HHVM Status

An Almsaeed's AdminLTE template built for Sleeping Owl's Admin, an administrative interface builder for Laravel 5.

Installation

Step 1: Download the package

Open a command console, enter your project directory and execute the following command to download the latest stable version of this package:

$ composer require gionnivaleriana/laravel-adminlte:dev-master

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the package

Then, enable the package by adding the following line in the app/config.php file of your project:

<?php
// app/config.php

return [

    'providers' => [

        // ...

        GionniValeriana\laravelAdminlte\AdminlteServiceProvider::class

    ],

    // ...

    'aliases' => [

        // ...

        'Adminlte' => GionniValeriana\laravelAdminlte\Adminlte::class,

    ],

];

Step 3: Use the package

To use the package/template overriding the default one by Sleeping Owl, modify the following line in the app/admin.php file of your project:

The app/admin.php file is generated during the Sleeping Owl's Admin package installation by the command admin:install.

<?php
// app/admin.php

return [

    // ...

    'bladePrefix' => 'adminlte::',

];

Then publish the assets (css, js..) to your public folder with the command

$ php artisan vendor:publish

Add the styles and scripts in the AppServiceProvider

<?php
// app/Providers/AppServiceProvider.php

    // ...

    public function register() {

        // ...

        config([
            'preload.styles' => [
                asset('packages/GionniValeriana/adminlte/bootstrap/css/bootstrap.min.css'),
                asset('packages/GionniValeriana/adminlte/plugins/font-awesome/font-awesome.min.css'),
                asset('packages/GionniValeriana/adminlte/plugins/ionicons/ionicons.min.css'),
                asset('packages/GionniValeriana/adminlte/dist/css/AdminLTE.min.css'),
                asset('packages/GionniValeriana/adminlte/dist/css/skins/_all-skins.min.css'),
                asset('packages/GionniValeriana/adminlte/plugins/iCheck/flat/blue.css'),
                asset('packages/GionniValeriana/adminlte/plugins/morris/morris.css'),
                asset('packages/GionniValeriana/adminlte/plugins/datatables/dataTables.bootstrap.css'),
                asset('packages/GionniValeriana/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css'),
                asset('packages/GionniValeriana/adminlte/plugins/datepicker/datepicker3.css'),
                asset('packages/GionniValeriana/adminlte/plugins/daterangepicker/daterangepicker-bs3.css'),
                asset('packages/GionniValeriana/adminlte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css'),
            ],
            'preload.scripts' => [
                asset('packages/GionniValeriana/adminlte/plugins/jQuery/jQuery-2.1.3.min.js'),
                asset('packages/GionniValeriana/adminlte/bootstrap/js/bootstrap.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/input-mask/jquery.inputmask.js'),
                asset('packages/GionniValeriana/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js'),
                asset('packages/GionniValeriana/adminlte/plugins/input-mask/jquery.inputmask.extensions.js'),
                asset('packages/GionniValeriana/adminlte/plugins/moment/moment.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/daterangepicker/daterangepicker.js'),
                asset('packages/GionniValeriana/adminlte/plugins/colorpicker/bootstrap-colorpicker.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/timepicker/bootstrap-timepicker.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/datatables/jquery.dataTables.js'),
                asset('packages/GionniValeriana/adminlte/plugins/datatables/dataTables.bootstrap.js'),
                asset('packages/GionniValeriana/adminlte/plugins/slimScroll/jquery.slimscroll.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/iCheck/icheck.min.js'),
                asset('packages/GionniValeriana/adminlte/plugins/fastclick/fastclick.min.js'),
            ],
        ]);
    }

And then load that with Sleeping Owl's bootstrap script

<?php
// app/admin/bootstrap.php

use Illuminate\Support\Facades\Config;
use SleepingOwl\Admin\AssetManager\AssetManager;

$assets = new AssetManager();

foreach (Config::get('preload.styles') as $style) {
    $assets->addStyle($style);
}

foreach (Config::get('preload.scripts') as $script) {
    $assets->addScript($script);
}

Usage

Let's start creating a "Start Page" menu item as described in Sleeping Owl's doc.

// app/admin/menu.php

Admin::menu()->url('/')
             ->label('Start Page')
             ->icon('fa-dashboard')
             ->uses('\App\HTTP\Controllers\AdminController@getIndex');

Standard blank page

To view the standard blank page from this package, in \App\HTTP\Controllers\AdminController the method AdminController::getIndex() should return this:

// app/Http/Controllers/AdminController.php

class AdminController extends \SleepingOwl\Admin\Controllers\AdminController {

    /**
     * @return \Illuminate\View\View
     */
    public function getIndex() {
        return view('adminlte::blank');
    }

    // ...

Custom page/view

To use instead a custom view, let's create a new one in the view folder (default in resources/views)

// resources/views/customPage.blade.php

@section('innerContent')
    <section class="content-header">
        <h1>Custom Page</h1>
        <ol class="breadcrumb">
            <li class="active"><i class="fa fa-dashboard"></i> Home</li>
        </ol>
    </section>
    <section class="content">

        // ...

    </section>
@stop

Then return it in AdminController::getIndex()

// app/Http/Controllers/AdminController.php

class AdminController extends \SleepingOwl\Admin\Controllers\AdminController {

    /**
     * @return \Illuminate\View\View
     */
    public function getIndex() {
        return view('customPage');
    }

    // ...

Requirements

Author