Skip to content

Commit f51138f

Browse files
committed
Enable package autodiscovery
1 parent a38bbab commit f51138f

2 files changed

Lines changed: 18 additions & 29 deletions

File tree

composer.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,22 @@
2424
"src/helpers.php"
2525
]
2626
},
27-
"minimum-stability": "stable"
27+
"minimum-stability": "stable",
28+
"extra": {
29+
"laravel": {
30+
"providers": [
31+
32+
],
33+
"aliases": {
34+
"Field": "Styde\\Html\\Facades\\Field",
35+
"Alert": "Styde\\Html\\Facades\\Alert",
36+
"Menu": "Styde\\Html\\Facades\\Menu",
37+
"Form": "Collective\\Html\\FormFacade",
38+
"Html": "Collective\\Html\\HtmlFacade"
39+
},
40+
"dont-discover": [
41+
"laravelcollective/html"
42+
]
43+
}
44+
}
2845
}

src/HtmlServiceProvider.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@ class HtmlServiceProvider extends ServiceProvider
3737
* @var bool
3838
*/
3939
protected $defer = false;
40-
/**
41-
* Automatically assign the global aliases for the component's facades
42-
* @var bool
43-
*/
44-
protected $globalAliases = [
45-
'Field' => \Styde\Html\Facades\Field::class,
46-
'Alert' => \Styde\Html\Facades\Alert::class,
47-
'Menu' => \Styde\Html\Facades\Menu::class,
48-
'Form' => \Collective\Html\FormFacade::class,
49-
'Html' => \Collective\Html\HtmlFacade::class
50-
];
5140

5241
public function boot()
5342
{
@@ -84,10 +73,6 @@ public function register()
8473
$this->registerAlertMiddleware();
8574

8675
$this->registerMenuGenerator();
87-
88-
if (!empty ($this->globalAliases)) {
89-
$this->registerFacadeAliases();
90-
}
9176
}
9277

9378
/**
@@ -297,19 +282,6 @@ protected function registerMenuGenerator()
297282
});
298283
}
299284

300-
/**
301-
* Register the facade aliases for this component
302-
*/
303-
protected function registerFacadeAliases()
304-
{
305-
$this->app->booting(function () {
306-
$loader = AliasLoader::getInstance();
307-
foreach ($this->globalAliases as $alias => $facade) {
308-
$loader->alias($alias, $facade);
309-
}
310-
});
311-
}
312-
313285
/**
314286
* Get the services provided by the provider.
315287
*

0 commit comments

Comments
 (0)