File tree Expand file tree Collapse file tree 2 files changed +31
-13
lines changed Expand file tree Collapse file tree 2 files changed +31
-13
lines changed Original file line number Diff line number Diff line change 1
- laravel-admin-helpers
2
- =====================
1
+ laravel-admin-ext/ helpers
2
+ =========================
3
3
4
4
[ ![ 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 )
7
7
8
8
[ Demo] ( http://120.26.143.106/admin ) use ` username/password:admin/admin `
9
9
10
10
## Installation
11
11
12
12
```
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;
14
22
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
16
37
```
17
38
18
39
## Usage
Original file line number Diff line number Diff line change 2
2
3
3
namespace Encore \Admin \Helpers ;
4
4
5
+ use Encore \Admin \Admin ;
5
6
use Encore \Admin \Auth \Database \Menu ;
6
- use Encore \Admin \Auth \Database \Permission ;
7
7
use Encore \Admin \Extension ;
8
8
use Illuminate \Support \Facades \Route ;
9
9
@@ -17,6 +17,8 @@ class Helpers extends Extension
17
17
public static function boot ()
18
18
{
19
19
static ::registerRoutes ();
20
+
21
+ Admin::extend ('helpers ' , __CLASS__ );
20
22
}
21
23
22
24
/**
@@ -94,11 +96,6 @@ public static function import()
94
96
Menu::create ($ menu );
95
97
}
96
98
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/* ' );
103
100
}
104
101
}
You can’t perform that action at this time.
0 commit comments