Skip to content

Commit a6561c9

Browse files
committed
change service provider to the facade
1 parent 86f4757 commit a6561c9

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

README.MD

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,11 @@ Or install it by running this command in your project root:
3737
composer require alutskevich/table-contents
3838
```
3939

40-
2. Add the `Lutskevich\TOC\TableContentsServiceProvider` provider to the `providers` array in
41-
`config/app.php`:
42-
```php
43-
'providers' => [
44-
Lutskevich\TOC\TableContentsServiceProvider::class,
45-
],
46-
```
47-
Then add the facade to your aliases array:
40+
2. Add the facade to your aliases array:
4841
```php
4942
'aliases' => [
5043
...
51-
'TableContents' => Lutskevich\TOC\TableContentsServiceProvider::class,
44+
'TableContents' => Lutskevich\TOC\TableContentsFacade::class,
5245
],
5346
```
5447
### Usage

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
"psr-4": {
2424
"Lutskevich\\TOC\\": "src"
2525
}
26-
}
26+
},
27+
"minimum-stability": "stable"
2728
}

src/TableContentsFacade.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace Lutskevich\TOC;
3+
4+
use Illuminate\Support\Facades\Facade;
5+
6+
class TableContentsFacade extends Facade
7+
{
8+
/**
9+
* Get the registered name of the component.
10+
*
11+
* @return string
12+
*/
13+
protected static function getFacadeAccessor()
14+
{
15+
return TableContents::class;
16+
}
17+
}

src/TableContentsServiceProvider.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)