Skip to content

Instantly share code, notes, and snippets.

@nuqz
Created July 15, 2017 12:01
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 nuqz/dd62c94e33e1cbffc1b4808a046e6e0a to your computer and use it in GitHub Desktop.
Save nuqz/dd62c94e33e1cbffc1b4808a046e6e0a to your computer and use it in GitHub Desktop.
Getting dummy application namespace to develop Laravel packages
<?
// Insert this before throw in getNamespace()
foreach ((array) data_get($composer, 'autoload-dev.psr-4') as $namespace => $path) {
foreach ((array) $path as $pathChoice) {
if (realpath(app_path()) == realpath(base_path().'/../'.$pathChoice)) {
return $this->namespace = $namespace;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment