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+ =========================
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
Original file line number Diff line number Diff line change 22
33namespace Encore \Admin \Helpers ;
44
5+ use Encore \Admin \Admin ;
56use Encore \Admin \Auth \Database \Menu ;
6- use Encore \Admin \Auth \Database \Permission ;
77use Encore \Admin \Extension ;
88use 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}
You can’t perform that action at this time.
0 commit comments