Skip to content

Instantly share code, notes, and snippets.

@morrislaptop
Created February 20, 2015 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morrislaptop/b7bcde14c04d550dd48d to your computer and use it in GitHub Desktop.
Save morrislaptop/b7bcde14c04d550dd48d to your computer and use it in GitHub Desktop.
<?php namespace App\Bridges;
use ReflectionClass;
trait LaravelFivePackageTrait {
public function boot()
{
$this->loadViewsFrom($this->namespace, $this->guessPackagePath() . '/views');
$this->loadTranslationsFrom($this->namespace, $this->guessPackagePath() . '/lang');
$this->app['config']->package($this->vendor . '/' . $this->namespace, $this->guessPackagePath() . '/config', $this->namespace);
}
protected function guessPackagePath() {
$path = (new ReflectionClass(get_parent_class()))->getFileName();
return realpath(dirname($path).'/../../');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment