Skip to content

Commit 669fe05

Browse files
author
songzou
committed
bug fix
1 parent 51384a0 commit 669fe05

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1-
laravel-admin-helpers
2-
=====================
1+
laravel-admin-ext/helpers
2+
=========================
33

44
[![StyleCI](https://styleci.io/repos/97667375/shield?branch=master)](https://styleci.io/repos/97667375)
5-
[![Packagist](https://img.shields.io/packagist/l/encore/laravel-admin-helpers.svg?maxAge=2592000)](https://packagist.org/packages/encore/laravel-admin-helpers)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/encore/laravel-admin-helpers.svg?style=flat-square)](https://packagist.org/packages/encore/laravel-admin-helpers)
5+
[![Packagist](https://img.shields.io/packagist/l/laravel-admin-ext/helpers.svg?maxAge=2592000)](https://packagist.org/packages/laravel-admin-ext/helpers)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-admin-ext/helpers.svg?style=flat-square)](https://packagist.org/packages/laravel-admin-ext/helpers)
77

88
[Demo](http://120.26.143.106/admin) use `username/password:admin/admin`
99

1010
## Installation
1111

1212
```
13-
$ composer require encore/laravel-admin-helpers
13+
$ composer require laravel-admin-ext/helpers
14+
```
15+
16+
Open `app/Providers/AppServiceProvider.php`, and call the `Helpers::boot` method within the `boot` method:
17+
18+
```php
19+
<?php
20+
21+
namespace App\Providers;
1422

15-
$ php artisan admin:import encore/laravel-admin-helpers
23+
use Encore\Admin\Helpers\Helpers;
24+
use Illuminate\Support\ServiceProvider;
25+
26+
class AppServiceProvider extends ServiceProvider
27+
{
28+
public function boot()
29+
{
30+
Helpers::boot();
31+
}
32+
}
33+
```
34+
35+
```
36+
$ php artisan admin:import helpers
1637
```
1738

1839
## Usage

src/Helpers.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Encore\Admin\Helpers;
44

5+
use Encore\Admin\Admin;
56
use Encore\Admin\Auth\Database\Menu;
6-
use Encore\Admin\Auth\Database\Permission;
77
use Encore\Admin\Extension;
88
use Illuminate\Support\Facades\Route;
99

@@ -17,6 +17,8 @@ class Helpers extends Extension
1717
public static function boot()
1818
{
1919
static::registerRoutes();
20+
21+
Admin::extend('helpers', __CLASS__);
2022
}
2123

2224
/**
@@ -94,11 +96,6 @@ public static function import()
9496
Menu::create($menu);
9597
}
9698

97-
// Add a permission.
98-
Permission::create([
99-
'name' => 'Admin helpers',
100-
'slug' => 'ext.helpers',
101-
'http_path' => admin_base_path('helpers/*'),
102-
]);
99+
parent::createPermission('Admin helpers', 'ext.helpers', 'helpers/*');
103100
}
104101
}

0 commit comments

Comments
 (0)