Skip to content

Commit

Permalink
Add AliasesProviderTrait.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Oct 24, 2014
1 parent e639146 commit b6050ad
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/Guardfile export-ignore
/build.xml export-ignore
/phpunit.xml export-ignore
/LICENSE.md export-ignore
Expand Down
36 changes: 36 additions & 0 deletions src/Support/Traits/AliasesProviderTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php namespace Orchestra\Support\Traits;

use Illuminate\Foundation\AliasLoader;

trait AliasesProviderTrait
{
/**
* Register facades aliases.
*
* @return void
*/
protected function registerFacadesAliases()
{
$loader = AliasLoader::getInstance();

foreach ($this->facades as $facade => $aliases) {
foreach ((array) $aliases as $alias) {
$loader->alias($alias, $facade);
}
}
}

/**
* Register the class aliases in the container.
*
* @return void
*/
protected function registerCoreContainerAliases()
{
foreach ($this->aliases as $key => $aliases) {
foreach ((array) $aliases as $alias) {
$this->app->alias($key, $alias);
}
}
}
}

0 comments on commit b6050ad

Please sign in to comment.